microsoft / nnfusion

A flexible and efficient deep neural network (DNN) compiler that generates high-performance executable from a DNN model description.
MIT License
952 stars 158 forks source link

Fix exit status is always zero #389

Closed siahuat0727 closed 2 years ago

siahuat0727 commented 2 years ago

363

Add sys.exit(main()) so that the console script entry-point in the pip-installable package will have the same behavior as when run directly (packaging-considerations). Additionally, the return value of os.system is system-dependent and may shift by 8 if the signal number is zero (os.system). This may cause the exit status is still 0 (low byte = signal number = 0), and therefore, I replaced it with subprocess.call.

Most systems require it to be in the range 0–127, and produce undefined results otherwise. (sys.exit)

I'd love to hear your feedback.