aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/tools
diff options
context:
space:
mode:
authorGravatar Michael Case <mikecase@google.com>2018-09-05 11:24:13 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-05 11:28:18 -0700
commitd3a63ee12b1c8910cf71e87a81e59f998144ce36 (patch)
tree103658aff5b2fea33bf060913f792fcac76ce0bb /tensorflow/python/tools
parent5d60dd9eab07bd02553cf7542641a08b0e3667cb (diff)
Internal Change.
PiperOrigin-RevId: 211666438
Diffstat (limited to 'tensorflow/python/tools')
-rw-r--r--tensorflow/python/tools/component_api_helper.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/python/tools/component_api_helper.py b/tensorflow/python/tools/component_api_helper.py
index 988ecc61f0..97f46719e5 100644
--- a/tensorflow/python/tools/component_api_helper.py
+++ b/tensorflow/python/tools/component_api_helper.py
@@ -65,9 +65,10 @@ def package_hook(parent_package_str, child_package_str, error_msg=None):
Will allow the following import statement to work.
>>> import parent.child
"""
- child_pkg_path = [os.path.join(os.path.dirname(child_pkg.__file__), "..")]
+ child_pkg_path = [os.path.abspath(
+ os.path.join(os.path.dirname(child_pkg.__file__), ".."))]
try:
- parent_pkg.__path__ += child_pkg_path
+ parent_pkg.__path__ = child_pkg_path + parent_pkg.__path__
except AttributeError:
parent_pkg.__path__ = child_pkg_path