Catch exception on tf_session.TF_NewStatus() (#9575)

* Catch exception on tf_session.TF_NewStatus()

"try" and "finally" without "except" is not sufficient to catch the exception.  The exception makes TensorFlow appear to be broken.  Fixes #8652

* Catching an AttributeError instead of broad exception type
This commit is contained in:
Shane 2017-05-03 20:38:21 -07:00 committed by Vijay Vasudevan
parent dc33e79fea
commit b0ab95c7af

View File

@ -594,6 +594,9 @@ class BaseSession(SessionInterface):
try:
status = tf_session.TF_NewStatus()
tf_session.TF_DeleteDeprecatedSession(self._session, status)
except AttributeError:
# 'NoneType' object has no attribute 'TF_NewStatus'
pass
finally:
if status is not None:
tf_session.TF_DeleteStatus(status)