From 10a43697b989a7c960c81c1b6b9180e9f4143ff7 Mon Sep 17 00:00:00 2001 From: elie Date: Sat, 19 Dec 2015 13:45:04 +0000 Subject: fix to NotificationOriginator to cope with unspecified user callable --- pysnmp/entity/rfc3413/ntforg.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pysnmp') diff --git a/pysnmp/entity/rfc3413/ntforg.py b/pysnmp/entity/rfc3413/ntforg.py index 5af3fe90..712c694c 100644 --- a/pysnmp/entity/rfc3413/ntforg.py +++ b/pysnmp/entity/rfc3413/ntforg.py @@ -270,9 +270,10 @@ class NotificationOriginator: not self.__pendingNotifications[notificationHandle]: if notificationHandle in self.__pendingNotifications: del self.__pendingNotifications[notificationHandle] - cbFun(snmpEngine, notificationHandle, - statusInformation['errorIndication'], 0, 0, (), - cbCtx) + if cbFun: + cbFun(snmpEngine, notificationHandle, + statusInformation['errorIndication'], 0, 0, (), + cbCtx) return notificationHandle debug.logger & debug.flagApp and debug.logger('sendVarBinds: notificationHandle %s, sendRequestHandle %s, timeout %d' % (notificationHandle, sendRequestHandle, timeout)) -- cgit v1.2.1