Python3.x undefined name 'xrange'
Changes:
- In Python 3, xrange() was removed,
and the built-in range() function i
was modified to behave like Pythoni
2.xx xrange(), returning an iterator.
Tested:
- NA
Change-Id: I9c4e9b628e445bc019a8d35c1a253b7cca83c449
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/pythonutil.py b/lib/pythonutil.py
index bf5e1a4..cba8654 100644
--- a/lib/pythonutil.py
+++ b/lib/pythonutil.py
@@ -4,7 +4,7 @@
def calcDottedNetmask(mask):
bits = 0
- for i in xrange(32 - mask, 32):
+ for i in range(32 - mask, 32):
bits |= 1 << i
packed_value = pack("!I", bits)
addr = inet_ntoa(packed_value)