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:
parent
55a6f73b49
commit
b7bf632d4e
|
@ -3108,7 +3108,7 @@ def _main():
|
||||||
type(exc).__name__,
|
type(exc).__name__,
|
||||||
exc)
|
exc)
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
if has_attrs:
|
if has_attrs:
|
||||||
parts = attrs.split(".")
|
parts = attrs.split(".")
|
||||||
|
@ -3118,7 +3118,7 @@ def _main():
|
||||||
|
|
||||||
if module.__name__ in sys.builtin_module_names:
|
if module.__name__ in sys.builtin_module_names:
|
||||||
print("Can't get info for builtin modules.", file=sys.stderr)
|
print("Can't get info for builtin modules.", file=sys.stderr)
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if args.details:
|
if args.details:
|
||||||
print('Target: {}'.format(target))
|
print('Target: {}'.format(target))
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
inspect.py now uses sys.exit() instead of exit()
|
Loading…
Reference in New Issue