From: W. Trevor King Date: Fri, 7 Mar 2014 04:21:22 +0000 (-0800) Subject: irkerd: Replace Exception.format_exc() with traceback.format_exc() X-Git-Tag: 2.7~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=19f7fd76087c68e9b318120e1351fd6543e8cdb2;p=irker.git irkerd: Replace Exception.format_exc() with traceback.format_exc() The former was giving me: Traceback (most recent call last): File "/usr/lib64/python3.3/threading.py", line 901, in _bootstrap_inner self.run() File "/usr/lib64/python3.3/threading.py", line 858, in run self._target(*self._args, **self._kwargs) File "./irkerd", line 637, in dequeue LOG.debug(e.format_exc()) AttributeError: 'TypeError' object has no attribute 'format_exc' In Python 3.3.4. --- diff --git a/irkerd b/irkerd index 34977ff..7f12c58 100755 --- a/irkerd +++ b/irkerd @@ -61,6 +61,7 @@ except ImportError: # Python 2 import sys import threading import time +import traceback try: # Python 3 import urllib.parse as urllib_parse except ImportError: # Python 2 @@ -583,7 +584,7 @@ class Connection: "irclib rejected a message to %s on %s " "because: %s") % ( channel, self.target, UNICODE_TYPE(err))) - LOG.debug(err.format_exc()) + LOG.debug(traceback.format_exc()) time.sleep(ANTI_FLOOD_DELAY) self.last_xmit = self.channels_joined[channel] = time.time() LOG.info("XMIT_TTL bump (%s transmission) at %s" % ( @@ -597,7 +598,7 @@ class Connection: LOG.error("exception %s in thread for %s" % (e, self.target)) # Maybe this should have its own status? self.status = "expired" - LOG.debug(e.format_exc()) + LOG.debug(traceback.format_exc()) finally: try: # Make sure we don't leave any zombies behind