[MERGE] Forward-port 7.0 up to rev. cb609bd425
This commit is contained in:
commit
67a63e2cc9
|
@ -1305,11 +1305,15 @@ else:
|
||||||
|
|
||||||
class Pickle(object):
|
class Pickle(object):
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, stream):
|
def load(cls, stream, errors=False):
|
||||||
unpickler = cPickle.Unpickler(stream)
|
unpickler = cPickle.Unpickler(stream)
|
||||||
# pickle builtins: str/unicode, int/long, float, bool, tuple, list, dict, None
|
# pickle builtins: str/unicode, int/long, float, bool, tuple, list, dict, None
|
||||||
unpickler.find_global = None
|
unpickler.find_global = None
|
||||||
return unpickler.load()
|
try:
|
||||||
|
return unpickler.load()
|
||||||
|
except Exception:
|
||||||
|
_logger.warning('Failed unpickling data, returning default: %r', errors, exc_info=True)
|
||||||
|
return errors
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def loads(cls, text):
|
def loads(cls, text):
|
||||||
|
|
Loading…
Reference in New Issue