diff options
Diffstat (limited to 'pysnmp/carrier/twisted/dgram/base.py')
-rw-r--r-- | pysnmp/carrier/twisted/dgram/base.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pysnmp/carrier/twisted/dgram/base.py b/pysnmp/carrier/twisted/dgram/base.py index 4995aec4..4386b702 100644 --- a/pysnmp/carrier/twisted/dgram/base.py +++ b/pysnmp/carrier/twisted/dgram/base.py @@ -32,8 +32,8 @@ class DgramTwistedTransport(DatagramProtocol, AbstractTwistedTransport): debug.logger & debug.flagIO and debug.logger('startProtocol: transportAddress %r outgoingMessage %s' % (transportAddress, debug.hexdump(outgoingMessage))) try: self.transport.write(outgoingMessage, transportAddress) - except Exception: - raise error.CarrierError('Twisted exception: %s' % (sys.exc_info()[1],)) + except Exception as exc: + raise error.CarrierError('Twisted exception: %s' % exc) def stopProtocol(self): debug.logger & debug.flagIO and debug.logger('stopProtocol: invoked') @@ -45,5 +45,5 @@ class DgramTwistedTransport(DatagramProtocol, AbstractTwistedTransport): else: try: self.transport.write(outgoingMessage, transportAddress) - except Exception: - raise error.CarrierError('Twisted exception: %s' % (sys.exc_info()[1],)) + except Exception as exc: + raise error.CarrierError('Twisted exception: %s' % exc) |