diff options
author | Alexander Schremmer <alex-bitbucket@alexanderweb.de> | 2007-09-26 11:42:02 +0000 |
---|---|---|
committer | Alexander Schremmer <alex-bitbucket@alexanderweb.de> | 2007-09-26 11:42:02 +0000 |
commit | 6801cde2b780a175c7f875b24f6747696e0ca7b3 (patch) | |
tree | 46142d544be4b87561695efb158b4c19b05c7cf5 /pypy/bin | |
parent | Yay! zlib seems to be basically working. (diff) | |
download | pypy-6801cde2b780a175c7f875b24f6747696e0ca7b3.tar.gz pypy-6801cde2b780a175c7f875b24f6747696e0ca7b3.tar.bz2 pypy-6801cde2b780a175c7f875b24f6747696e0ca7b3.zip |
Move the oldstyle translation option to py.py and app_main.py to make it setable at runtime.
Diffstat (limited to 'pypy/bin')
-rwxr-xr-x | pypy/bin/py.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pypy/bin/py.py b/pypy/bin/py.py index 848e057184..c396a2705f 100755 --- a/pypy/bin/py.py +++ b/pypy/bin/py.py @@ -37,6 +37,9 @@ cmdline_optiondescr = OptionDescription("interactive", "the options of py.py", [ StrOption("runcommand", "program passed in as CMD (terminates option list)", default=None, cmdline="-c"), + BoolOption("oldstyle_classes", + "Use old-style classes by default.", + default=False, cmdline="-k --oldstyle"), ]) pypy_init = gateway.applevel(''' @@ -73,11 +76,9 @@ def main_(argv=None): space = option.make_objspace(config) space._starttime = starttime - #assert 'pypy.tool.udir' not in sys.modules, ( - # "running py.py should not import pypy.tool.udir, which is\n" - # "only for testing or translating purposes.") - # ^^^ _socket and other rctypes-based modules need udir - space.setitem(space.sys.w_dict,space.wrap('executable'),space.wrap(argv[0])) + space.setitem(space.sys.w_dict, space.wrap('executable'), space.wrap(argv[0])) + if interactiveconfig.oldstyle_classes: + space.setitem(space.builtin.w_dict, space.wrap('__metaclass__'), space.w_classobj) # store the command-line arguments into sys.argv go_interactive = interactiveconfig.interactive |