You can just return `p.returncode`. The code that calls `main()` will pass it to `sys.exit()`.