The first two example snippets (pages 419 and 420) have main() return 0 / 0 or 1, but in the following two versions on pages 421-422, main() does not return anything, yet sys.exit(main(sys.argv)) is kept (here and here in the example code). (Likely a copy-and-paste error, and fortunately sys.exit(None) acts like success, too.) It could just invoke main(sys.argv).