summaryrefslogtreecommitdiff
path: root/pysnmp/entity/rfc3413/cmdgen.py
diff options
context:
space:
mode:
Diffstat (limited to 'pysnmp/entity/rfc3413/cmdgen.py')
-rw-r--r--pysnmp/entity/rfc3413/cmdgen.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pysnmp/entity/rfc3413/cmdgen.py b/pysnmp/entity/rfc3413/cmdgen.py
index 98cac48c..59503d52 100644
--- a/pysnmp/entity/rfc3413/cmdgen.py
+++ b/pysnmp/entity/rfc3413/cmdgen.py
@@ -92,8 +92,8 @@ class CommandGenerator(object):
)
return
- except StatusInformation:
- statusInformation = sys.exc_info()[1]
+ except StatusInformation as exc:
+ statusInformation = exc
debug.logger & debug.flagApp and debug.logger(
'processResponsePdu: origSendRequestHandle %s, _sendPdu() failed with %r' % (
sendPduHandle, statusInformation))
@@ -290,8 +290,8 @@ class NextCommandGenerator(NextCommandGeneratorSingleRun):
(targetName, contextEngineId, contextName,
reqPDU, cbFun, cbCtx))
- except StatusInformation:
- statusInformation = sys.exc_info()[1]
+ except StatusInformation as exc:
+ statusInformation = exc
debug.logger & debug.flagApp and debug.logger(
'sendVarBinds: sendPduHandle %s: sendPdu() failed with %r' % (sendRequestHandle, statusInformation))
cbFun(snmpEngine, sendRequestHandle,
@@ -373,8 +373,8 @@ class BulkCommandGenerator(BulkCommandGeneratorSingleRun):
(targetName, nonRepeaters, maxRepetitions,
contextEngineId, contextName, reqPDU, cbFun, cbCtx))
- except StatusInformation:
- statusInformation = sys.exc_info()[1]
+ except StatusInformation as exc:
+ statusInformation = exc
debug.logger & debug.flagApp and debug.logger(
'processResponseVarBinds: sendPduHandle %s: _sendPdu() failed with %r' % (
sendRequestHandle, statusInformation))