traceback.format_exc(e), cant pass e, that will cause exception in exception then crash #1665
Unanswered
alenwesker
asked this question in
Q&A
Replies: 2 comments
-
This isn't an issue with debugpy. Moving to discussions. |
Beta Was this translation helpful? Give feedback.
0 replies
-
traceback changed somewhere along the way. If you want to do what you're doing here, you'd do this instead: import sys
def some_function():
try:
raise RuntimeError("Some error message")
except Exception as e:
import traceback
sys.stderr.write("\n".join(traceback.format_exception(e)))
if __name__ == '__main__':
some_function() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Before creating a new issue, please check the FAQ to see if your question is answered there.
Environment data
Actual behavior
I was writing traceback.format_exc(e) in my project as well, as far as I remember, that's the way in the older versions, but any newer document and versions said, traceback.format_exe() does not accept e as the parameter
I am cleaning my code, then found that debugpy also contains lines like that: like eval_condition in breakpoint.py
Can anyone tell me when Python deletes that first parameter? Since there is code in pydebugy like that, we could call it like that once upon a time.
Expected behavior
cause exception in exception then crash
Steps to reproduce:
Beta Was this translation helpful? Give feedback.
All reactions