Work around a 2to3 bug. PYTHON-494
This commit is contained in:
parent
ba66a2dde7
commit
d863ccf458
@ -520,7 +520,13 @@ def decode_all(data, as_class=dict,
|
||||
except Exception:
|
||||
# Change exception type to InvalidBSON but preserve traceback.
|
||||
exc_type, exc_value, exc_tb = sys.exc_info()
|
||||
raise InvalidBSON, InvalidBSON(str(exc_value)), exc_tb
|
||||
if PY3:
|
||||
e = InvalidBSON(str(exc_value))
|
||||
raise e.with_traceback(exc_tb)
|
||||
else:
|
||||
# 2to3 mistranslates this.
|
||||
raise InvalidBSON, InvalidBSON(str(exc_value)), exc_tb
|
||||
|
||||
if _use_c:
|
||||
decode_all = _cbson.decode_all
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user