From 845e891ea98a40fb6c2d3cc0749f942fb3755def Mon Sep 17 00:00:00 2001 From: lakshman kumar Date: Wed, 25 Mar 2020 10:30:34 -0700 Subject: [PATCH] Fix bug in get-next: test start-oid/end-oid separately --- pyagentx/network.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyagentx/network.py b/pyagentx/network.py index 9711398..1982fd1 100644 --- a/pyagentx/network.py +++ b/pyagentx/network.py @@ -117,11 +117,16 @@ def _get_next_oid(self, oid, endoid): for i in range(len(tlist)): try: sok = int(slist[i]) <= int(tlist[i]) + except IndexError: + #sok = True, on most recent successful comparison + pass + try: eok = int(elist[i]) >= int(tlist[i]) - if not ( sok and eok ): - break except IndexError: + #eok = True, on most recent successful comparison pass + if not ( sok and eok ): + break if sok and eok: return tmp_oid return None # No match!