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 3e6dccdcf1a57c..2b22666af0c654 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 @@ -279,7 +279,7 @@ def Main(): ret_code = subprocess.call(args) shutil.rmtree(os.path.dirname(module_space), True) MaybeEmitHostVersionWarning(ret_code) - exit(ret_code) + sys.exit(ret_code) else: # On Windows, os.execv doesn't handle arguments with spaces correctly, # and it actually starts a subprocess just like subprocess.call. @@ -288,7 +288,7 @@ def Main(): if IsWindows() or %enable_host_version_warning%: ret_code = subprocess.call(args) MaybeEmitHostVersionWarning(ret_code) - exit(ret_code) + sys.exit(ret_code) else: os.execv(args[0], args) except EnvironmentError: