aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/test
diff options
context:
space:
mode:
authorGravatar Michael Case <mikecase@google.com>2018-09-21 15:36:17 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-21 15:40:27 -0700
commit47d8a750bc0a9e3165e8fc61d38df3646bf8f278 (patch)
tree069537b9931f508cc85684675f10b413fe11ad5e /tensorflow/tools/test
parent9655bbd9d67a62b4af399100201918f138316dac (diff)
Fix "from tensorflow._api.v1 import *".
PiperOrigin-RevId: 214055060
Diffstat (limited to 'tensorflow/tools/test')
-rw-r--r--tensorflow/tools/test/check_futures_test.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tensorflow/tools/test/check_futures_test.py b/tensorflow/tools/test/check_futures_test.py
index 9181c9bd4a..a883ce221f 100644
--- a/tensorflow/tools/test/check_futures_test.py
+++ b/tensorflow/tools/test/check_futures_test.py
@@ -37,6 +37,7 @@ BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))
FUTURES_PATTERN = re.compile(r'^from __future__ import (\w+)\s*$')
FUTURES_PATTERN_2 = re.compile(
r'^from __future__ import (\w+), (\w+), (\w+)\s*$')
+FUTURES_PATTERN_3 = re.compile(r'^from __future__ import (\w+) as \w+\s*$')
REQUIRED_FUTURES = frozenset(['absolute_import', 'division', 'print_function'])
WHITELIST = [
@@ -59,6 +60,8 @@ def check_file(path, old_division):
for line in open(path, encoding='utf-8') if six.PY3 else open(path):
count += 1
m = FUTURES_PATTERN.match(line)
+ if not m:
+ m = FUTURES_PATTERN_3.match(line)
if m:
futures.add(m.group(1))
else: