We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a3d6c1 commit 7ea2e5bCopy full SHA for 7ea2e5b
ptpython/repl.py
@@ -270,7 +270,13 @@ def show_result(self, result: object) -> None:
270
out_prompt = to_formatted_text(self.get_output_prompt())
271
272
# If the repr is valid Python code, use the Pygments lexer.
273
- result_repr = repr(result)
+ try:
274
+ result_repr = repr(result)
275
+ except BaseException as e:
276
+ # Calling repr failed.
277
+ self._handle_exception(e)
278
+ return
279
+
280
try:
281
compile(result_repr, "", "eval")
282
except SyntaxError:
0 commit comments