__main__.py 472 B

123456789101112131415161718
  1. """Main entry point"""
  2. import sys
  3. if sys.argv[0].endswith("__main__.py"):
  4. import os.path
  5. # We change sys.argv[0] to make help message more useful
  6. # use executable without path, unquoted
  7. # (it's just a hint anyway)
  8. # (if you have spaces in your executable you get what you deserve!)
  9. executable = os.path.basename(sys.executable)
  10. sys.argv[0] = executable + " -m unittest"
  11. del os
  12. __unittest = True
  13. from .main import main
  14. main(module=None)