Remove certain symbols from tensorflow.__all__.
When deleting `compiler`, `core` and `python` symbols from `tensorflow`, we currently don't remove them from `__all__`. This breaks anybody who tries to do `from tensorflow import *`. PiperOrigin-RevId: 243897920
This commit is contained in:
parent
7708e8c53a
commit
5a93bb319c
@ -118,7 +118,11 @@ if _running_from_pip_package():
|
||||
# pylint: disable=undefined-variable
|
||||
try:
|
||||
del python
|
||||
if '__all__' in vars():
|
||||
vars()['__all__'].remove('python')
|
||||
del core
|
||||
if '__all__' in vars():
|
||||
vars()['__all__'].remove('core')
|
||||
except NameError:
|
||||
# Don't fail if these modules are not available.
|
||||
# For e.g. this file will be originally placed under tensorflow/_api/v1 which
|
||||
@ -129,6 +133,8 @@ except NameError:
|
||||
# others don't exist.
|
||||
try:
|
||||
del compiler
|
||||
if '__all__' in vars():
|
||||
vars()['__all__'].remove('compiler')
|
||||
except NameError:
|
||||
pass
|
||||
# pylint: enable=undefined-variable
|
||||
|
Loading…
Reference in New Issue
Block a user