Argument-Clinic / cpython

The Python programming language
https://www.python.org/
Other
1 stars 0 forks source link

Rework error handling #1

Closed erlend-aasland closed 1 year ago

erlend-aasland commented 1 year ago

Currently, we've got the warn and fail functions (which both call warn_or_fail behind the scenes). The latter will print to stdout and sys.exit(-1). IMO, this is a bad design. If the Argument Clinic tool exits with an error, we should print to stderr, as every well-behaved command line tool should do.

If we rewrote so fail raises a ClinicError exception and warn uses warnings.warn, we could...: