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:
parent
dc33e79fea
commit
b0ab95c7af
@ -594,6 +594,9 @@ class BaseSession(SessionInterface):
|
|||||||
try:
|
try:
|
||||||
status = tf_session.TF_NewStatus()
|
status = tf_session.TF_NewStatus()
|
||||||
tf_session.TF_DeleteDeprecatedSession(self._session, status)
|
tf_session.TF_DeleteDeprecatedSession(self._session, status)
|
||||||
|
except AttributeError:
|
||||||
|
# 'NoneType' object has no attribute 'TF_NewStatus'
|
||||||
|
pass
|
||||||
finally:
|
finally:
|
||||||
if status is not None:
|
if status is not None:
|
||||||
tf_session.TF_DeleteStatus(status)
|
tf_session.TF_DeleteStatus(status)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user