diff options
author | 2017-07-24 18:54:55 +0200 | |
---|---|---|
committer | 2017-07-24 21:04:51 +0200 | |
commit | ad73cba3caa2e08ad61ea9ca63f9111cde1f48d1 (patch) | |
tree | 22947c4d092e2497d6a6bc44b1c9e9ad5aaefb76 /src/main/java | |
parent | e619d6a54aa44585305c5feced5cb512f230b1bc (diff) |
Fix python_stub_template.txt to be compatible with Python 2.4.
PiperOrigin-RevId: 162949753
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt index 218f6aeae2..2aacd411e6 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt @@ -166,7 +166,9 @@ def Main(): exit(retCode) else: os.execv(args[0], args) - except EnvironmentError as e: + except EnvironmentError: + # This works from Python 2.4 all the way to 3.x. + e = sys.exc_info()[1] # This exception occurs when os.execv() fails for some reason. if not getattr(e, 'filename', None): e.filename = program # Add info to error message |