from six.moves import xrange for Python 3
authorcclauss <cclauss@bluewin.ch>
Fri, 23 Feb 2018 17:51:28 +0000 (18:51 +0100)
committerGitHub <noreply@github.com>
Fri, 23 Feb 2018 17:51:28 +0000 (18:51 +0100)
Lines 1785 and 1818 contain calls to the Python 2-only builtin function __xrange()__ which was removed in Python 3 in favor of __range()__.  This PR adds the line [__from six.moves import xrange__](https://pythonhosted.org/six/#module-six.moves) for compatibility with both Python 2 and Python 3.

tensorflow/contrib/lite/testing/generate_examples.py

index 2481add..5488b71 100644 (file)
@@ -36,6 +36,7 @@ import traceback
 import zipfile
 import numpy as np
 from six import StringIO
+from six.moves import xrange
 
 # TODO(aselle): Disable GPU for now
 os.environ["CUDA_VISIBLE_DEVICES"] = "-1"