[pypy-commit] pypy default: Be even more careful.
arigo
noreply at buildbot.pypy.org
Wed Jun 6 11:41:54 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r55427:519e061adb07
Date: 2012-06-06 11:41 +0200
http://bitbucket.org/pypy/pypy/changeset/519e061adb07/
Log: Be even more careful.
diff --git a/lib-python/2.7/pickle.py b/lib-python/2.7/pickle.py
--- a/lib-python/2.7/pickle.py
+++ b/lib-python/2.7/pickle.py
@@ -694,7 +694,10 @@
def _pickle_maybe_moduledict(self, obj):
# save module dictionary as "getattr(module, '__dict__')"
try:
- themodule = sys.modules[obj['__name__']]
+ name = obj['__name__']
+ if type(name) is not str:
+ return None
+ themodule = sys.modules[name]
if type(themodule) is not ModuleType:
return None
if themodule.__dict__ is not obj:
More information about the pypy-commit
mailing list