Lines Matching refs:sys
1 # Emulate sys.argv and run __main__.py or __main__.pyc in an environment that
13 import sys
20 if not sys.argv or sys.argv[0][:1] == '-':
22 _dir = os.path.split(sys.executable)[0] # removes "python"
25 sys.argv.insert(0, '__rawmain__')
27 _dir = os.path.split(sys.argv[0])[0]
31 # modules this sys.path modification is necessary to be able to import them.
33 sys.path.insert(0, _dir)
35 # Create sys.argv
46 sys.argv[0] = __file__
47 del argvemulator, os, sys, _dir
55 sys.argv[0] = __file__
63 del argvemulator, os, sys, marshal, _dir, _fp
66 sys.stderr.write("%s: neither __main__.py nor __main__.pyc found\n"%sys.argv[0])
67 sys.exit(1)