summaryrefslogtreecommitdiff
path: root/pysnmp/proto/api/v2c.py
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2019-06-23 09:04:26 +0200
committerIlya Etingof <etingof@gmail.com>2019-06-23 09:06:15 +0200
commitbe7de7d7a72ed73777bcae6eff0ba0f698172548 (patch)
tree8590f5166e7a089d70b2e6997a642ea0bf41860e /pysnmp/proto/api/v2c.py
parentcde062dd42f67dfd2d7686286a322d40e9c3a4b7 (diff)
downloadpysnmp-git-be7de7d7a72ed73777bcae6eff0ba0f698172548.tar.gz
Fix `var-bindings` initialization
Set `var-bindings` to an empty sequence by default. Otherwise it can remain a "pyasn1 schema object" failing to encode. This can happen with newer pyasn1 versions where `SequenceOf` type does not have default initializer.
Diffstat (limited to 'pysnmp/proto/api/v2c.py')
-rw-r--r--pysnmp/proto/api/v2c.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pysnmp/proto/api/v2c.py b/pysnmp/proto/api/v2c.py
index c415ca9a..0470fafd 100644
--- a/pysnmp/proto/api/v2c.py
+++ b/pysnmp/proto/api/v2c.py
@@ -119,7 +119,8 @@ class BulkPDUAPI(PDUAPI):
2, self._maxRepetitions, verifyConstraints=False, matchTags=False,
matchConstraints=False)
- pdu.setComponentByPosition(3)
+ varBindList = pdu.setComponentByPosition(3).getComponentByPosition(3)
+ varBindList.clear()
@staticmethod
def getNonRepeaters(pdu):