[IPython-dev] fixing warnings in python2.6

Ondrej Certik ondrej@certik...
Mon Mar 16 22:18:52 CDT 2009


Hi,

the attached patch fixes the annoying warning in python2.6:

$ ipython
/var/lib/python-support/python2.6/IPython/Magic.py:38:
DeprecationWarning: the sets module is deprecated
  from sets import Set
Python 2.6.1+ (r261:67515, Mar  2 2009, 13:11:28)
Type "copyright", "credits" or "license" for more information.

IPython 0.9.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]:



I created the patch with:

$ bzr send -o python2.6.patch
Using saved parent location
"http://bazaar.launchpad.net/%7Eipython-dev/ipython/trunk/" to
determine what changes to submit.
Bundling 1 revision(s).


is that the correct way?

How can I execute tests? I tried to find such an info at:

http://ipython.scipy.org/moin/Developer_Zone

but haven't find it. If I try nosetests I get:

$ nosetests
Traceback (most recent call last):
  File "/usr/bin/nosetests", line 8, in <module>
    load_entry_point('nose==0.10.3', 'console_scripts', 'nosetests')()
  File "/var/lib/python-support/python2.6/nose/core.py", line 219, in __init__
    argv=argv, testRunner=testRunner, testLoader=testLoader)
  File "/usr/lib/python2.6/unittest.py", line 817, in __init__
    self.runTests()
  File "/var/lib/python-support/python2.6/nose/core.py", line 298, in runTests
    result = self.testRunner.run(self.test)
  File "/var/lib/python-support/python2.6/nose/core.py", line 62, in run
    test(result)
  File "/var/lib/python-support/python2.6/nose/suite.py", line 132, in __call__
    return self.run(*arg, **kw)
  File "/var/lib/python-support/python2.6/nose/suite.py", line 162, in run
    test(orig)
  File "/usr/lib/python2.6/unittest.py", line 464, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.6/unittest.py", line 457, in run
    for test in self._tests:
  File "/var/lib/python-support/python2.6/nose/suite.py", line 76, in _get_tests
    for test in self.test_generator:
  File "/var/lib/python-support/python2.6/nose/loader.py", line 165,
in loadTestsFromDir
    entry_path, discovered=True)
  File "/var/lib/python-support/python2.6/nose/loader.py", line 377,
in loadTestsFromName
    module, discovered=discovered)
  File "/var/lib/python-support/python2.6/nose/loader.py", line 301,
in loadTestsFromModule
    tests.extend(self.loadTestsFromDir(path))
  File "/var/lib/python-support/python2.6/nose/loader.py", line 165,
in loadTestsFromDir
    entry_path, discovered=True)
  File "/var/lib/python-support/python2.6/nose/loader.py", line 377,
in loadTestsFromName
    module, discovered=discovered)
  File "/var/lib/python-support/python2.6/nose/loader.py", line 306,
in loadTestsFromModule
    return self.suiteClass(ContextList(tests, context=module))
  File "/var/lib/python-support/python2.6/nose/suite.py", line 332, in __call__
    return self.makeSuite(tests, context)
  File "/var/lib/python-support/python2.6/nose/suite.py", line 377, in makeSuite
    self.context.setdefault(suite, []).append(context)
TypeError: unhashable type: 'ContextSuite'



If I try py.test I get:

$ py.test
[... lots of errors ]

E   from IPython import Release
>   ImportError: cannot import name Release

[/home/ondrej/repos/ipython/IPython/ipstruct.py:13]
________________________________________________________________________________
============= tests finished: 3 passed, 31 failed in 0.14 seconds ==============




so I think that's not the way. :)  Anyway, so I didn't test my patch
yet --- but I will once you point me to the right direction.

Thanks,
Ondrej
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python2.6.patch
Type: text/x-diff
Size: 2524 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/ipython-dev/attachments/20090316/3d71f324/attachment-0001.bin 


More information about the IPython-dev mailing list