[SciPy-Dev] Scipy on Python 3

Charles R Harris charlesr.harris@gmail....
Mon Sep 13 16:25:43 CDT 2010


On Mon, Sep 13, 2010 at 2:33 PM, Charles R Harris <charlesr.harris@gmail.com
> wrote:

>
>
> On Mon, Sep 13, 2010 at 2:23 PM, Charles R Harris <
> charlesr.harris@gmail.com> wrote:
>
>>
>>
>> On Mon, Sep 13, 2010 at 2:06 PM, Pauli Virtanen <pav@iki.fi> wrote:
>>
>>> Mon, 13 Sep 2010 15:01:27 -0500, Bruce Southey wrote:
>>> [clip]
>>> > There are a lot of 'PendingDeprecationWarning: Please use assertTrue
>>> > instead.' messages resulting from the usage of failUnless which is
>>> > deprecated since version 2.7.
>>>
>>> Unfortunately, we can't use assertTrue since it's not in Python 2.4. Also
>>> these could be changed to user assert_(), similarly how Warren changed
>>> recently bare asserts.
>>>
>>>
>> Numpy uses assertTrue, it is present in python2.4 but undocumented. I had
>> a sed script to make all the needed replacements...
>>
>>
> Here is the script
>
> s/\<failUnless\>/assertTrue/g
> s/\<failIf\>/assertFalse/g
> s/\<failUnlessEqual\>/assertEqual/g
> s/\<failUnlessRaises\>/assertRaises/g
>
>
I made the changes in r6805. For future reference on mass changes like that:

find scipy -name "test*.py" -exec sed --in-place=bck --file=sedfixdeprecated
{} +

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20100913/a346af85/attachment.html 


More information about the SciPy-Dev mailing list