bpo-38059: Using sys.exit() over exit() in inspect.py (GH-15666)

Constants added by the site module like exit() "should not be used in programs"
(cherry picked from commit e3c59a7527)

Co-authored-by: Alan Yee <alanyee@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2019-09-09 08:20:36 -07:00 committed by GitHub
parent 3bd4bed78a
commit 0d4396c04c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -3118,7 +3118,7 @@ def _main():
type(exc).__name__,
exc)
print(msg, file=sys.stderr)
exit(2)
sys.exit(2)
if has_attrs:
parts = attrs.split(".")
@ -3128,7 +3128,7 @@ def _main():
if module.__name__ in sys.builtin_module_names:
print("Can't get info for builtin modules.", file=sys.stderr)
exit(1)
sys.exit(1)
if args.details:
print('Target: {}'.format(target))

View File

@ -0,0 +1 @@
inspect.py now uses sys.exit() instead of exit()