fix: py3 compatibility for error snapshot creation (develop) (#9336)
* fix: py3 compatibility for error snapshot creation * fix: remove invalid checks * Revert "fix: remove invalid checks" This reverts commit f636c122146e38a5e0cd964686a6c7187ccb53b4. * fix: use six to maintain py2 and py3 compatibility
This commit is contained in:
parent
f11b8fc476
commit
b427c934b0
1 changed files with 2 additions and 2 deletions
|
|
@ -128,14 +128,14 @@ def get_snapshot(exception, context=10):
|
|||
value = pydoc.text.repr(getattr(evalue, name))
|
||||
|
||||
# render multilingual string properly
|
||||
if type(value)==str and value.startswith(b"u'"):
|
||||
if isinstance(value, six.text_type):
|
||||
value = eval(value)
|
||||
|
||||
s['exception'][name] = encode(value)
|
||||
|
||||
# add all local values (of last frame) to the snapshot
|
||||
for name, value in locals.items():
|
||||
if type(value)==str and value.startswith(b"u'"):
|
||||
if isinstance(value, six.text_type):
|
||||
value = eval(value)
|
||||
|
||||
s['locals'][name] = pydoc.text.repr(value)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue