diff options
author | maheshgudi | 2018-07-06 14:04:48 +0530 |
---|---|---|
committer | maheshgudi | 2018-07-12 18:27:27 +0530 |
commit | 0b2980148288b44571820e1176dea0e2dffcec81 (patch) | |
tree | cd68a4b3ff1264ba8a4053f10d4e315968156daa /yaksh | |
parent | ec0903e00ffab1f0f0e6e674637243cd6a548115 (diff) | |
download | online_test-0b2980148288b44571820e1176dea0e2dffcec81.tar.gz online_test-0b2980148288b44571820e1176dea0e2dffcec81.tar.bz2 online_test-0b2980148288b44571820e1176dea0e2dffcec81.zip |
Fix unicode issue in grader
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/grader.py | 8 |
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: |