Show More
@@ -2068,13 +2068,17 b' class InteractiveShell(SingletonConfigurable):' | |||||
2068 | except KeyboardInterrupt: |
|
2068 | except KeyboardInterrupt: | |
2069 | print('\n' + self.get_exception_only(), file=sys.stderr) |
|
2069 | print('\n' + self.get_exception_only(), file=sys.stderr) | |
2070 |
|
2070 | |||
2071 | def _showtraceback(self, etype, evalue, stb): |
|
2071 | def _showtraceback(self, etype, evalue, stb: str): | |
2072 | """Actually show a traceback. |
|
2072 | """Actually show a traceback. | |
2073 |
|
2073 | |||
2074 | Subclasses may override this method to put the traceback on a different |
|
2074 | Subclasses may override this method to put the traceback on a different | |
2075 | place, like a side channel. |
|
2075 | place, like a side channel. | |
2076 | """ |
|
2076 | """ | |
2077 |
|
|
2077 | val = self.InteractiveTB.stb2text(stb) | |
|
2078 | try: | |||
|
2079 | print(val) | |||
|
2080 | except UnicodeEncodeError: | |||
|
2081 | print(val.encode('utf-8', 'backslashreplace').decode()) | |||
2078 |
|
2082 | |||
2079 | def showsyntaxerror(self, filename=None, running_compiled_code=False): |
|
2083 | def showsyntaxerror(self, filename=None, running_compiled_code=False): | |
2080 | """Display the syntax error that just occurred. |
|
2084 | """Display the syntax error that just occurred. |
General Comments 0
You need to be logged in to leave comments.
Login now