简体   繁体   中英

traceback.print_exc() python question

I am using the following line of code in IDLE to print out my traceback in an eception:

traceback.print_exc()

For some reason I get the red text error message, but then it is followed by a blue text of "None".

Not sure what that None is about, any ideas?

print_exc() prints formatted exception to stderr. If you need string value, call format_exc()

print_exc() doesn't return anything, which in Python is actually returning None . Looks like IDLE is showing you the None it returned.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM