From b7c8bd53eb73e9378fcc60931b4705da12aae51a Mon Sep 17 00:00:00 2001 From: albarytu Date: Tue, 3 Nov 2015 16:46:12 +0100 Subject: [PATCH] Update network.py --- pyagentx/network.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pyagentx/network.py b/pyagentx/network.py index 9711398..a98c88a 100644 --- a/pyagentx/network.py +++ b/pyagentx/network.py @@ -114,15 +114,20 @@ def _get_next_oid(self, oid, endoid): elist = endoid.split('.') for tmp_oid in self.data_idx: tlist = tmp_oid.split('.') - for i in range(len(tlist)): - try: - sok = int(slist[i]) <= int(tlist[i]) - eok = int(elist[i]) >= int(tlist[i]) - if not ( sok and eok ): + ok=True + for i in range(len(slist)): + s=int(slist[i] + if i t: + ok=False break - except IndexError: - pass - if sok and eok: + if i e: + ok = False + break + if ok: return tmp_oid return None # No match!