diff options
author | Jonathan Hseu <jhseu@google.com> | 2016-11-04 11:53:50 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-11-04 13:05:51 -0700 |
commit | 879e0accd1c833771c8058d3eb5f2d4f06f895d4 (patch) | |
tree | 81635e1bd758cd8a8e5ec760db70fc72f6480c66 /tensorflow/core/util/reporter.cc | |
parent | a2c8e99777cc0b961fb42106af5bd527a43e76f7 (diff) |
Change FileExists to return tensorflow::Status.
Also done separately by @llhe at github.com/tensorflow/tensorflow/pull/5370. We needed to do this change internally to fix all callers.
Motivation: The existing FileExists interface doesn't allow callers to distinguish between file not found vs. filesystem errors.
Semantics changes:
- gfile.Exists in Python now throws an exception for filesystem errors. It continues to return true/false if it can accurately determine whether a file exists.
- RecursivelyCreateDir now returns errors for filesystem errors when calling FileExists.
Change: 138224013
Diffstat (limited to 'tensorflow/core/util/reporter.cc')
-rw-r--r-- | tensorflow/core/util/reporter.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/core/util/reporter.cc b/tensorflow/core/util/reporter.cc index a7e4b48175..c4896fe2ac 100644 --- a/tensorflow/core/util/reporter.cc +++ b/tensorflow/core/util/reporter.cc @@ -54,7 +54,7 @@ Status TestReporter::Initialize() { string mangled_fname = strings::StrCat( fname_, str_util::Join(str_util::Split(test_name_, '/'), "__")); Env* env = Env::Default(); - if (env->FileExists(mangled_fname)) { + if (env->FileExists(mangled_fname).ok()) { return errors::InvalidArgument("Cannot create TestReporter, file exists: ", mangled_fname); } |