aboutsummaryrefslogtreecommitdiff
path: root/pypy/bin
diff options
context:
space:
mode:
authorAlexander Schremmer <alex-bitbucket@alexanderweb.de>2007-09-26 11:42:02 +0000
committerAlexander Schremmer <alex-bitbucket@alexanderweb.de>2007-09-26 11:42:02 +0000
commit6801cde2b780a175c7f875b24f6747696e0ca7b3 (patch)
tree46142d544be4b87561695efb158b4c19b05c7cf5 /pypy/bin
parentYay! zlib seems to be basically working. (diff)
downloadpypy-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-xpypy/bin/py.py11
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