Import traceback only on exception

This commit is contained in:
tomkat83 2016-07-20 08:24:36 +02:00
parent 92cf5bd517
commit 1dc576965a

View file

@ -1,5 +1,4 @@
import re import re
import traceback
from SocketServer import ThreadingMixIn from SocketServer import ThreadingMixIn
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from urlparse import urlparse, parse_qs from urlparse import urlparse, parse_qs
@ -247,6 +246,7 @@ class MyHandler(BaseHTTPRequestHandler):
except: except:
self.logMsg('Error encountered. Traceback:', -1) self.logMsg('Error encountered. Traceback:', -1)
import traceback
self.logMsg(traceback.print_exc(), -1) self.logMsg(traceback.print_exc(), -1)