Catch name errors, in case these symbols are not injected.
PiperOrigin-RevId: 266214332
This commit is contained in:
parent
ee99f977e2
commit
5314df48bf
@ -104,4 +104,29 @@ if not isinstance(_sys.modules[__name__], _deprecation.DeprecationWrapper):
|
|||||||
_sys.modules[__name__] = _deprecation.DeprecationWrapper(
|
_sys.modules[__name__] = _deprecation.DeprecationWrapper(
|
||||||
_sys.modules[__name__], "")
|
_sys.modules[__name__], "")
|
||||||
|
|
||||||
|
# These should not be visible in the main tf module.
|
||||||
|
try:
|
||||||
|
del core
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
del python
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
del compiler
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
del tools
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
del examples
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
# LINT.ThenChange(//tensorflow/virtual_root_template_v2.__init__.py.oss)
|
# LINT.ThenChange(//tensorflow/virtual_root_template_v2.__init__.py.oss)
|
||||||
|
@ -97,4 +97,29 @@ for _m in _top_level_modules:
|
|||||||
# We still need all the names that are toplevel on tensorflow_core
|
# We still need all the names that are toplevel on tensorflow_core
|
||||||
from tensorflow_core import *
|
from tensorflow_core import *
|
||||||
|
|
||||||
|
# These should not be visible in the main tf module.
|
||||||
|
try:
|
||||||
|
del core
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
del python
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
del compiler
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
del tools
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
del examples
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
# LINT.ThenChange(//tensorflow/virtual_root_template_v1.__init__.py.oss)
|
# LINT.ThenChange(//tensorflow/virtual_root_template_v1.__init__.py.oss)
|
||||||
|
Loading…
Reference in New Issue
Block a user