aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Julian Berman <Julian@GrayVines.com>2017-02-09 13:09:43 -0500
committerGravatar Geoffrey Irving <irving@naml.us>2017-02-09 10:09:43 -0800
commitc7fca9eed7b584cbfd95b253908c51f4e9b7fa8b (patch)
treec429b9eb2b3b1169b5d3904847f7ce6626309322
parent4ecd72b68cd70c3930551aebbf0c80badc301d28 (diff)
Make this not UnboundLocalError if the actual TF_NewStatus failed. (#7386)
Closes #7356.
-rw-r--r--tensorflow/python/framework/errors_impl.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/python/framework/errors_impl.py b/tensorflow/python/framework/errors_impl.py
index 79e0b5f069..e557772dd4 100644
--- a/tensorflow/python/framework/errors_impl.py
+++ b/tensorflow/python/framework/errors_impl.py
@@ -459,8 +459,8 @@ def _make_specific_exception(node_def, op, message, error_code):
@contextlib.contextmanager
def raise_exception_on_not_ok_status():
+ status = pywrap_tensorflow.TF_NewStatus()
try:
- status = pywrap_tensorflow.TF_NewStatus()
yield status
if pywrap_tensorflow.TF_GetCode(status) != 0:
raise _make_specific_exception(