sys.exit(1) vs raise SystemExit vs raise

Stephen Hansen me at ixokai.io
Sat Apr 16 01:34:32 EDT 2016


> * You can use named constants from ‘os’ for the purpose of specifying
>   exit status numbers.

Only on *nix. 

Even then it varies from platform to platform which constants you can
use. I'd prefer to document the return status and use numbers/my own
constants directly, that way supporting any platform (even windows,
where its %ERRORLEVEL%

--S



More information about the Python-list mailing list