aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/autograph/pyct/static_analysis/live_values.py
diff options
context:
space:
mode:
authorGravatar Dan Moldovan <mdan@google.com>2018-10-04 19:26:26 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-04 19:30:55 -0700
commitf4cef34fad7b00a3b1f288ff5c95001c5b83c1f8 (patch)
tree77d2d4bcd8f4e710850609179b563581b41f6fa9 /tensorflow/python/autograph/pyct/static_analysis/live_values.py
parent5608454c31bb298096bb6aa463b33baa2fa68f08 (diff)
Fix regression that caused xrange to be ignored.
PiperOrigin-RevId: 215844450
Diffstat (limited to 'tensorflow/python/autograph/pyct/static_analysis/live_values.py')
-rw-r--r--tensorflow/python/autograph/pyct/static_analysis/live_values.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/python/autograph/pyct/static_analysis/live_values.py b/tensorflow/python/autograph/pyct/static_analysis/live_values.py
index 36b9e7074d..4ceddce53b 100644
--- a/tensorflow/python/autograph/pyct/static_analysis/live_values.py
+++ b/tensorflow/python/autograph/pyct/static_analysis/live_values.py
@@ -24,6 +24,7 @@ from __future__ import division
from __future__ import print_function
import gast
+import six
from tensorflow.python.autograph.pyct import anno
from tensorflow.python.autograph.pyct import transformer
@@ -35,6 +36,9 @@ from tensorflow.python.autograph.pyct.static_analysis.annos import NodeAnno
# These symbols are legal in Python, but don't appear in the namespace.
_SPECIAL_SYMBOLS = {'range': range, 'print': print}
+if six.PY2:
+ _SPECIAL_SYMBOLS['xrange'] = xrange
+
class LiveValueResolver(transformer.Base):
"""Annotates nodes with live values."""