Skip to content

Commit

Permalink
Use sys.exit() instead of exit() in stub script
Browse files Browse the repository at this point in the history
`exit()` doesn't exist if python was invoked without the `site` module. See bazelbuild#7947 (comment) (bazelbuild#7947).

RELNOTES: None
PiperOrigin-RevId: 249636384
  • Loading branch information
brandjon authored and irengrig committed Jun 18, 2019
1 parent d67d745 commit 38d4845
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
Expand Down

0 comments on commit 38d4845

Please sign in to comment.