diff options
author | 2018-04-18 13:29:43 -0700 | |
---|---|---|
committer | 2018-04-18 13:32:52 -0700 | |
commit | 6fa949afca5f1549f87554475d053c608f0da379 (patch) | |
tree | a81809862d982aa5e3bda7e1954cc5cb7f6ba4b5 /tensorflow/tools/git | |
parent | f28342c2caab42987e6761abeca84ba3147cddba (diff) |
Catch OSError in gen_git_source.py subprocess call.
OSError occurs if git cannot be found. This is a initial fix for some
Windows build errors.
PiperOrigin-RevId: 193407250
Diffstat (limited to 'tensorflow/tools/git')
-rwxr-xr-x | tensorflow/tools/git/gen_git_source.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/tools/git/gen_git_source.py b/tensorflow/tools/git/gen_git_source.py index cbcdbf5b80..78d511969e 100755 --- a/tensorflow/tools/git/gen_git_source.py +++ b/tensorflow/tools/git/gen_git_source.py @@ -125,7 +125,7 @@ def configure(src_base_path, gen_path, debug=False): try: # In python 3.5, symlink function exists even on Windows. But requires # Windows Admin privileges, otherwise an OSError will be thrown. - if hasattr(os, 'symlink'): + if hasattr(os, "symlink"): os.symlink(src, os.path.join(gen_path, target)) else: shutil.copy2(src, os.path.join(gen_path, target)) @@ -162,7 +162,7 @@ def get_git_version(git_base_path): str("--work-tree=" + git_base_path), "describe", "--long", "--tags" ]).strip()) return val if val else unknown_label - except subprocess.CalledProcessError: + except (subprocess.CalledProcessError, OSError): return unknown_label |