Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba32b72

Browse files
committed
Merged revisions 64736-64737 via svnmerge from
svn+ssh://[email protected]/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://[email protected]/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. ................
1 parent 0d748c2 commit ba32b72

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

Lib/lib2to3/fixes/fix_imports.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
# XXX: overhead to the fixer.
2020
MAPPING = {"StringIO": ("io", ["StringIO"]),
2121
"cStringIO": ("io", ["StringIO"]),
22+
"cPickle": ("pickle", ['BadPickleGet', 'HIGHEST_PROTOCOL',
23+
'PickleError', 'Pickler', 'PicklingError',
24+
'UnpickleableError', 'Unpickler', 'UnpicklingError',
25+
'compatible_formats', 'dump', 'dumps', 'format_version',
26+
'load', 'loads']),
2227
"__builtin__" : ("builtins", builtin_names),
2328
'copy_reg': ('copyreg', ['pickle',
2429
'constructor',

Lib/lib2to3/tests/test_fixers.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,10 +1405,7 @@ def test_unchanged(self):
14051405
s = "foo(xreadlines)"
14061406
self.unchanged(s)
14071407

1408-
# Disable test, as it takes a too long time to run, and also
1409-
# fails in 2.6.
1410-
#class Test_imports(FixerTestCase):
1411-
class Test_imports:
1408+
class Test_imports(FixerTestCase):
14121409
fixer = "imports"
14131410
from ..fixes.fix_imports import MAPPING as modules
14141411

Lib/test/test_lib2to3.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
# because of running
33
from lib2to3.tests import test_fixers, test_pytree, test_util
44
import unittest
5-
from test.support import run_unittest
5+
from test.support import run_unittest, requires
6+
7+
# Don't run lib2to3 tests by default since they take too long
8+
if __name__ != '__main__':
9+
requires('lib2to3')
610

711
def suite():
812
tests = unittest.TestSuite()

0 commit comments

Comments
 (0)