diff --git a/Lib/inspect.py b/Lib/inspect.py index 4d4f33dcc57..7f0517207d1 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -3108,7 +3108,7 @@ def _main(): type(exc).__name__, exc) print(msg, file=sys.stderr) - exit(2) + sys.exit(2) if has_attrs: parts = attrs.split(".") @@ -3118,7 +3118,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)) diff --git a/Misc/NEWS.d/next/Library/2019-09-08-11-36-50.bpo-38059.8SA6co.rst b/Misc/NEWS.d/next/Library/2019-09-08-11-36-50.bpo-38059.8SA6co.rst new file mode 100644 index 00000000000..001952ae126 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-09-08-11-36-50.bpo-38059.8SA6co.rst @@ -0,0 +1 @@ +inspect.py now uses sys.exit() instead of exit()