[pypy-svn] r2766 - in pypy/trunk/src/pypy: interpreter module
arigo at codespeak.net
arigo at codespeak.net
Sun Jan 11 16:51:26 CET 2004
Author: arigo
Date: Sun Jan 11 16:51:25 2004
New Revision: 2766
Modified:
pypy/trunk/src/pypy/interpreter/py.py
pypy/trunk/src/pypy/module/sysinterp.py
pypy/trunk/src/pypy/module/sysmodule.py
Log:
Added 'sys.argv'. Now we can run appspace/pystone.py again, with
a number of iterations limited to 5 or 10 :-)
Modified: pypy/trunk/src/pypy/interpreter/py.py
==============================================================================
--- pypy/trunk/src/pypy/interpreter/py.py (original)
+++ pypy/trunk/src/pypy/interpreter/py.py Sun Jan 11 16:51:25 2004
@@ -33,6 +33,10 @@
go_interactive = Options.interactive
banner = ''
if Options.command:
+ args = ['-c']
+ for arg in args:
+ space.call_method(space.sys.w_argv, 'append', space.wrap(arg))
+ if Options.command:
try:
main.run_string(Options.command[0], '<string>', space)
except error.PyPyError, pypyerr:
Modified: pypy/trunk/src/pypy/module/sysinterp.py
==============================================================================
--- pypy/trunk/src/pypy/module/sysinterp.py (original)
+++ pypy/trunk/src/pypy/module/sysinterp.py Sun Jan 11 16:51:25 2004
@@ -54,6 +54,7 @@
# Common data structures
w_modules = space.newdict([])
w_warnoptions = space.newlist([])
+w_argv = space.newlist([])
builtin_module_names.sort()
w_builtin_module_names = space.newtuple([space.wrap(fn)
for fn in builtin_module_names])
Modified: pypy/trunk/src/pypy/module/sysmodule.py
==============================================================================
--- pypy/trunk/src/pypy/module/sysmodule.py (original)
+++ pypy/trunk/src/pypy/module/sysmodule.py Sun Jan 11 16:51:25 2004
@@ -5,7 +5,8 @@
__interplevel__execfile('sysinterp.py')
# Common data structures
-from __interplevel__ import path, modules, warnoptions, builtin_module_names
+from __interplevel__ import path, modules, argv
+from __interplevel__ import warnoptions, builtin_module_names
# Objects from interpreter-level
from __interplevel__ import stdin, stdout, stderr, maxint
More information about the Pypy-commit
mailing list