mirror of
https://github.com/python/cpython.git
synced 2025-08-25 11:15:02 +00:00
parent
ecfeb7f095
commit
70a6b49821
246 changed files with 926 additions and 962 deletions
|
@ -145,16 +145,16 @@ class ScriptBinding:
|
|||
dirname = os.path.dirname(filename)
|
||||
# XXX Too often this discards arguments the user just set...
|
||||
interp.runcommand("""if 1:
|
||||
_filename = %s
|
||||
_filename = %r
|
||||
import sys as _sys
|
||||
from os.path import basename as _basename
|
||||
if (not _sys.argv or
|
||||
_basename(_sys.argv[0]) != _basename(_filename)):
|
||||
_sys.argv = [_filename]
|
||||
import os as _os
|
||||
_os.chdir(%s)
|
||||
_os.chdir(%r)
|
||||
del _filename, _sys, _basename, _os
|
||||
\n""" % (`filename`, `dirname`))
|
||||
\n""" % (filename, dirname))
|
||||
interp.prepend_syspath(filename)
|
||||
interp.runcode(code)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue