From b427c934b092fbf0e2ad305f8580bea3fec2d673 Mon Sep 17 00:00:00 2001 From: Rohan Date: Mon, 27 Jan 2020 21:32:23 +0530 Subject: [PATCH] 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 --- frappe/utils/error.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/utils/error.py b/frappe/utils/error.py index 43579cf92e..c124410a7f 100644 --- a/frappe/utils/error.py +++ b/frappe/utils/error.py @@ -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)