diff options
author | elie <elie> | 2011-11-06 20:37:09 +0000 |
---|---|---|
committer | elie <elie> | 2011-11-06 20:37:09 +0000 |
commit | c239eaf23775c4149623d726f1d61be31c0c40b2 (patch) | |
tree | 153d0d2788dd840b1729dccbbde69ff63bcac2b1 /pysnmp/entity/rfc3413/ntfrcv.py | |
parent | 42d5c35838a0726fd60683080e5677a76719ef2f (diff) | |
download | pysnmp-c239eaf23775c4149623d726f1d61be31c0c40b2.tar.gz |
major overhawl aimed at Python 2.4 through 3.2 compatibility
Diffstat (limited to 'pysnmp/entity/rfc3413/ntfrcv.py')
-rw-r--r-- | pysnmp/entity/rfc3413/ntfrcv.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pysnmp/entity/rfc3413/ntfrcv.py b/pysnmp/entity/rfc3413/ntfrcv.py index e933330..64f1988 100644 --- a/pysnmp/entity/rfc3413/ntfrcv.py +++ b/pysnmp/entity/rfc3413/ntfrcv.py @@ -1,3 +1,4 @@ +from pyasn1.compat.octets import null from pysnmp.proto import rfc3411, error from pysnmp.proto.api import v1, v2c # backend is always SMIv2 compliant from pysnmp.proto.proxy import rfc2576 @@ -13,7 +14,7 @@ class NotificationReceiver: def __init__(self, snmpEngine, cbFun, cbCtx=None): snmpEngine.msgAndPduDsp.registerContextEngineId( - '', self.pduTypes, self.processPdu # '' is a wildcard + null, self.pduTypes, self.processPdu # '' is a wildcard ) self.__cbFunVer = 0 self.__cbFun = cbFun @@ -21,7 +22,7 @@ class NotificationReceiver: def close(self, snmpEngine): snmpEngine.msgAndPduDsp.unregisterContextEngineId( - '', self.pduTypes + null, self.pduTypes ) def processPdu( @@ -86,8 +87,8 @@ class NotificationReceiver: stateReference, statusInformation ) - except error.StatusInformation, why: - debug.logger & debug.flagApp and debug.logger('processPdu: stateReference %s, statusInformation %s' % (stateReference, why)) + except error.StatusInformation: + debug.logger & debug.flagApp and debug.logger('processPdu: stateReference %s, statusInformation %s' % (stateReference, sys.exc_info()[1])) snmpSilentDrops, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpSilentDrops') snmpSilentDrops.syntax = snmpSilentDrops.syntax + 1 |