Browse Source

Give a traceback in the log

master
Robert Miles 2 years ago
parent
commit
ab1677893b
  1. 10
      parse_email.py

10
parse_email.py

@ -1,13 +1,17 @@
#!/usr/bin/python3
import utils,sys,subprocess
import utils,sys,subprocess,traceback
utils.setcwd("/home/anonhmmst")
email = utils.input()
def log(x):
with utils.open("log.txt","a") as f:
f.write(x+"\n")
try:
email = utils.input()
except:
errcls,e,tb = sys.exc_info()
log(traceback.format_exception_only(errcls,e))
title = email.get("Subject")
payload = email.get_payload()

Loading…
Cancel
Save