Merged revisions 64736-64737 via svnmerge from
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 5 Jul 2008 15:55:00 +0000 (15:55 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 5 Jul 2008 15:55:00 +0000 (15:55 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

................
  r64736 | martin.v.loewis | 2008-07-05 17:45:45 +0200 (Sa, 05 Jul 2008) | 20 lines

  Merged revisions 64285-64735 via svnmerge from
  svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

  ........
    r64493 | benjamin.peterson | 2008-06-24 04:14:14 +0200 (Di, 24 Jun 2008) | 1 line

    add a fix_import mapping for cPickle -> pickle
  ........
    r64651 | brett.cannon | 2008-07-02 04:00:11 +0200 (Mi, 02 Jul 2008) | 3 lines

    Update fix_imports for urllib. Had to change the fixer itself to handle modules
    that are split across several renames in 3.0.
  ........
    r64669 | brett.cannon | 2008-07-02 21:43:48 +0200 (Mi, 02 Jul 2008) | 4 lines

    Backing out last change until fix_imports is working again. Also re-enable the
    testing for fix_imports; if it is deemed that it takes too long to run then a
    random sample should be taken and used to test it.
  ........
................
  r64737 | martin.v.loewis | 2008-07-05 17:48:20 +0200 (Sa, 05 Jul 2008) | 2 lines

  Disable lib2to3 by default, unless run explicitly.
................

Lib/lib2to3/fixes/fix_imports.py
Lib/lib2to3/tests/test_fixers.py
Lib/test/test_lib2to3.py

index 03a27bc38ecdda9132e8a2a9cd4e81b5dc48e7fc..a7a4086d526264dd4866ff869dd053346637867f 100644 (file)
@@ -19,6 +19,11 @@ builtin_names = [name for name in dir(builtins)
 # XXX: overhead to the fixer.
 MAPPING = {"StringIO":  ("io", ["StringIO"]),
            "cStringIO": ("io", ["StringIO"]),
+           "cPickle": ("pickle", ['BadPickleGet', 'HIGHEST_PROTOCOL',
+                                  'PickleError', 'Pickler', 'PicklingError',
+                                  'UnpickleableError', 'Unpickler', 'UnpicklingError',
+                                  'compatible_formats', 'dump', 'dumps', 'format_version',
+                                  'load', 'loads']),
            "__builtin__" : ("builtins", builtin_names),
            'copy_reg': ('copyreg', ['pickle',
                                     'constructor',
index d1d25095f6b2ab5350dee265f20d72ff209e7c47..9079341776f911badc23b443f37fc31d7ea47567 100755 (executable)
@@ -1405,10 +1405,7 @@ class Test_xreadlines(FixerTestCase):
         s = "foo(xreadlines)"
         self.unchanged(s)
 
-# Disable test, as it takes a too long time to run, and also
-# fails in 2.6.
-#class Test_imports(FixerTestCase):
-class Test_imports:
+class Test_imports(FixerTestCase):
     fixer = "imports"
     from ..fixes.fix_imports import MAPPING as modules
 
index 9bd4496726a1c5d3ea6bece232ea856ca71e94e1..3af6afa6d468e3fa9429d03e2a488e503df023e8 100644 (file)
@@ -2,7 +2,11 @@
 # because of running
 from lib2to3.tests import test_fixers, test_pytree, test_util
 import unittest
-from test.support import run_unittest
+from test.support import run_unittest, requires
+
+# Don't run lib2to3 tests by default since they take too long
+if __name__ != '__main__':
+    requires('lib2to3')
 
 def suite():
     tests = unittest.TestSuite()