how to make python gracefully fail?,sys.exit(main())