Show More
@@ -187,7 +187,12 b' class DisplayHook(Configurable):' | |||||
187 | # But avoid extraneous empty lines. |
|
187 | # But avoid extraneous empty lines. | |
188 | result_repr = '\n' + result_repr |
|
188 | result_repr = '\n' + result_repr | |
189 |
|
189 | |||
|
190 | try: | |||
190 | print(result_repr) |
|
191 | print(result_repr) | |
|
192 | except UnicodeEncodeError: | |||
|
193 | # If a character is not supported by the terminal encoding replace | |||
|
194 | # it with its \u or \x representation | |||
|
195 | print(result_repr.encode(sys.stdout.encoding,'backslashreplace').decode(sys.stdout.encoding)) | |||
191 |
|
196 | |||
192 | def update_user_ns(self, result): |
|
197 | def update_user_ns(self, result): | |
193 | """Update user_ns with various things like _, __, _1, etc.""" |
|
198 | """Update user_ns with various things like _, __, _1, etc.""" |
General Comments 0
You need to be logged in to leave comments.
Login now