From 41db0e0eea3125c6db4b467390803006e0f5f6a0 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 9 Oct 2015 13:48:21 +0200 Subject: [PATCH] range to xrange (leftovers) --- lib/takeover/udf.py | 4 ++-- thirdparty/chardet/eucjpprober.py | 2 +- thirdparty/chardet/mbcharsetprober.py | 2 +- thirdparty/chardet/sjisprober.py | 2 +- thirdparty/chardet/utf8prober.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/takeover/udf.py b/lib/takeover/udf.py index aa10b3c63..d5f951383 100644 --- a/lib/takeover/udf.py +++ b/lib/takeover/udf.py @@ -258,7 +258,7 @@ class UDF: else: logger.warn("invalid value, only digits are allowed") - for x in range(0, udfCount): + for x in xrange(0, udfCount): while True: msg = "what is the name of the UDF number %d? " % (x + 1) udfName = readInput(msg) @@ -293,7 +293,7 @@ class UDF: else: logger.warn("invalid value, only digits >= 0 are allowed") - for y in range(0, parCount): + for y in xrange(0, parCount): msg = "what is the data-type of input parameter " msg += "number %d? (default: %s) " % ((y + 1), defaultType) diff --git a/thirdparty/chardet/eucjpprober.py b/thirdparty/chardet/eucjpprober.py index 8e64fdcc2..2d5b2701c 100644 --- a/thirdparty/chardet/eucjpprober.py +++ b/thirdparty/chardet/eucjpprober.py @@ -51,7 +51,7 @@ class EUCJPProber(MultiByteCharSetProber): def feed(self, aBuf): aLen = len(aBuf) - for i in range(0, aLen): + for i in xrange(0, aLen): # PY3K: aBuf is a byte array, so aBuf[i] is an int, not a byte codingState = self._mCodingSM.next_state(aBuf[i]) if codingState == constants.eError: diff --git a/thirdparty/chardet/mbcharsetprober.py b/thirdparty/chardet/mbcharsetprober.py index bb42f2fb5..c98cc6228 100644 --- a/thirdparty/chardet/mbcharsetprober.py +++ b/thirdparty/chardet/mbcharsetprober.py @@ -52,7 +52,7 @@ class MultiByteCharSetProber(CharSetProber): def feed(self, aBuf): aLen = len(aBuf) - for i in range(0, aLen): + for i in xrange(0, aLen): codingState = self._mCodingSM.next_state(aBuf[i]) if codingState == constants.eError: if constants._debug: diff --git a/thirdparty/chardet/sjisprober.py b/thirdparty/chardet/sjisprober.py index cd0e9e707..4edb6df9b 100644 --- a/thirdparty/chardet/sjisprober.py +++ b/thirdparty/chardet/sjisprober.py @@ -51,7 +51,7 @@ class SJISProber(MultiByteCharSetProber): def feed(self, aBuf): aLen = len(aBuf) - for i in range(0, aLen): + for i in xrange(0, aLen): codingState = self._mCodingSM.next_state(aBuf[i]) if codingState == constants.eError: if constants._debug: diff --git a/thirdparty/chardet/utf8prober.py b/thirdparty/chardet/utf8prober.py index 1c0bb5d8f..42d32ec3a 100644 --- a/thirdparty/chardet/utf8prober.py +++ b/thirdparty/chardet/utf8prober.py @@ -69,7 +69,7 @@ class UTF8Prober(CharSetProber): def get_confidence(self): unlike = 0.99 if self._mNumOfMBChar < 6: - for i in range(0, self._mNumOfMBChar): + for i in xrange(0, self._mNumOfMBChar): unlike = unlike * ONE_CHAR_PROB return 1.0 - unlike else: