[FIX] P3: Unpickler.find_global -> Unpickler.find_class

This commit is contained in:
Xavier Morel
2017-06-26 16:45:03 +02:00
parent aaf8f3e37f
commit c5dcf75a81
+5 -3
View File
@@ -1104,10 +1104,12 @@ def _consteq(str1, str2):
consteq = getattr(passlib.utils, 'consteq', _consteq)
# forbid globals entirely: str/unicode, int/long, float, bool, tuple, list, dict, None
class Unpickler(pickle_.Unpickler, object):
find_global = None # Python 2
find_class = None # Python 3
def _pickle_load(stream, errors=False):
unpickler = pickle_.Unpickler(stream)
# pickle builtins: str/unicode, int/long, float, bool, tuple, list, dict, None
unpickler.find_global = None
unpickler = Unpickler(stream)
try:
return unpickler.load()
except Exception: