From 52f4a69a11e3354ce54004977222418fb38162b8 Mon Sep 17 00:00:00 2001 From: Rahul Huilgol <huilgolr@amazon.com> Date: Thu, 20 Feb 2020 23:45:13 +0000 Subject: [PATCH] Revert "remove the try except block around hasAtomicMove" This reverts commit 411f70eb0ef6f7f26e91c3de3d8e24d5b0e618e7. --- tensorflow/python/lib/io/file_io.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tensorflow/python/lib/io/file_io.py b/tensorflow/python/lib/io/file_io.py index c50b702a5be..fa303b18c23 100644 --- a/tensorflow/python/lib/io/file_io.py +++ b/tensorflow/python/lib/io/file_io.py @@ -603,7 +603,11 @@ def has_atomic_move(path): we need to be careful about using moves. In some cases it is safer not to use temporary locations in this case. """ - return _pywrap_file_io.HasAtomicMove(compat.as_bytes(path)) + try: + return _pywrap_file_io.HasAtomicMove(compat.as_bytes(path)) + except errors.OpError: + # defaults to True + return True @tf_export(v1=["gfile.ListDirectory"])