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 70dd3bd commit 3bf3998Copy full SHA for 3bf3998
ptpython/repl.py
@@ -239,7 +239,10 @@ def eval(self, line: str) -> object:
239
# above, then `sys.exc_info()` would not report the right error.
240
# See issue: https://github.com/prompt-toolkit/ptpython/issues/435
241
code = self._compile_with_flags(line, "exec")
242
- exec(code, self.get_globals(), self.get_locals())
+ result = eval(code, self.get_globals(), self.get_locals())
243
+
244
+ if _has_coroutine_flag(code):
245
+ result = asyncio.get_event_loop().run_until_complete(result)
246
247
return None
248
0 commit comments