Minor improvements / nitpicking
- Use argparse's "required" parameter instead of checking if the argument is None. - Drop stream parameter from logging.basicConfig because sys.stderr is used by default. - Don't catch exceptions only for printing them to stderr and exiting with exit code 1, because that is exactly what happens if an exception is not caught. - Don't use sys.exit(main()) with a main function that doesn't return anything. Clarification wrt. "Don't catch exceptions only for printing them […]": the behavior _is_ different in that before this commit, we would hide the resulting stacktrace. But there's no situation in which we expect main() to raise an exception here, so IMO hiding exceptions was a bug. Thank you for fixing it :) -- intrigeri
Loading
Please register or sign in to comment