summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaheshgudi2018-07-06 14:04:48 +0530
committermaheshgudi2018-07-12 18:27:27 +0530
commit0b2980148288b44571820e1176dea0e2dffcec81 (patch)
treecd68a4b3ff1264ba8a4053f10d4e315968156daa
parentec0903e00ffab1f0f0e6e674637243cd6a548115 (diff)
downloadonline_test-0b2980148288b44571820e1176dea0e2dffcec81.tar.gz
online_test-0b2980148288b44571820e1176dea0e2dffcec81.tar.bz2
online_test-0b2980148288b44571820e1176dea0e2dffcec81.zip
Fix unicode issue in grader
-rw-r--r--yaksh/grader.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/yaksh/grader.py b/yaksh/grader.py
index c8356f3..c1be493 100644
--- a/yaksh/grader.py
+++ b/yaksh/grader.py
@@ -167,10 +167,14 @@ class Grader(object):
line_no = traceback.extract_tb(exc_tb)[-1][1]
if len(tb_list) > 2:
del tb_list[1:3]
+ try:
+ exc_value = str(exc_value)
+ except UnicodeEncodeError:
+ exc_value = unicode(exc_value)
error.append(
prettify_exceptions(
- exc_type.__name__, str(exc_value), "".join(tb_list),
- line_no=line_no
+ exc_type.__name__, exc_value,
+ "".join(tb_list), line_no=line_no
)
)
finally: