diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2009-11-24 17:53:23 (GMT) |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2009-11-24 17:53:23 (GMT) |
commit | 8b2d713d3294b148afe5e31a0d284e4a5065b63a (patch) | |
tree | 669f9600b1d77490ba629b4eb51b6cc717f5c44a /Lib/test | |
parent | 1d2c16db7ee7cd14a98fef4b3ec689be861bdcf0 (diff) | |
download | cpython-8b2d713d3294b148afe5e31a0d284e4a5065b63a.zip cpython-8b2d713d3294b148afe5e31a0d284e4a5065b63a.tar.gz cpython-8b2d713d3294b148afe5e31a0d284e4a5065b63a.tar.bz2 |
Issue 7128: Removed reference to the non-existent copyreg module.
The reference to copyreg was a unnoticed leftover from the compatibility
support for the grand renaming of the standard library in Python 3. The
compatibility support was reverted in r63493, but not completely as this
patch shows.
Based on a patch by Amaury Forgeot d'Arc.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/pickletester.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 8f96d74..04bb842 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -1091,6 +1091,16 @@ class AbstractPickleModuleTests(unittest.TestCase): s = StringIO.StringIO("X''.") self.assertRaises(EOFError, self.module.load, s) + def test_restricted(self): + # issue7128: cPickle failed in restricted mode + builtins = {self.module.__name__: self.module, + '__import__': __import__} + d = {} + teststr = "def f(): {0}.dumps(0)".format(self.module.__name__) + exec teststr in {'__builtins__': builtins}, d + d['f']() + + class AbstractPersistentPicklerTests(unittest.TestCase): # This class defines persistent_id() and persistent_load() |