[pypy-commit] pypy default: make it possible to have the target return just the main function, which is by
cfbolz
noreply at buildbot.pypy.org
Wed Jul 31 13:42:08 CEST 2013
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch:
Changeset: r65862:cf4c83c12bb3
Date: 2013-07-31 13:41 +0200
http://bitbucket.org/pypy/pypy/changeset/cf4c83c12bb3/
Log: make it possible to have the target return just the main function,
which is by far the most common case nowadays.
diff --git a/rpython/translator/driver.py b/rpython/translator/driver.py
--- a/rpython/translator/driver.py
+++ b/rpython/translator/driver.py
@@ -544,9 +544,14 @@
try:
entry_point, inputtypes, policy = spec
+ except TypeError:
+ # not a tuple at all
+ entry_point = spec
+ inputtypes = policy = None
except ValueError:
+ policy = None
entry_point, inputtypes = spec
- policy = None
+
driver.setup(entry_point, inputtypes,
policy=policy,
diff --git a/rpython/translator/goal/targetnopstandalone.py b/rpython/translator/goal/targetnopstandalone.py
--- a/rpython/translator/goal/targetnopstandalone.py
+++ b/rpython/translator/goal/targetnopstandalone.py
@@ -19,4 +19,4 @@
# _____ Define and setup target ___
def target(*args):
- return entry_point, None
+ return entry_point
diff --git a/rpython/translator/goal/targetrpystonedalone.py b/rpython/translator/goal/targetrpystonedalone.py
--- a/rpython/translator/goal/targetrpystonedalone.py
+++ b/rpython/translator/goal/targetrpystonedalone.py
@@ -60,13 +60,12 @@
# _____ Define and setup target ___
def target(*args):
- return entry_point, None
+ return entry_point
"""
Why is this a stand-alone target?
-The above target specifies None as the argument types list.
-This is a case treated specially in the driver.py . If the list
-of input types is empty, it is meant to be a list of strings,
-actually implementing argv of the executable.
+The above target specifies no argument types list.
+This is a case treated specially in the driver.py . The only argument is meant
+to be a list of strings, actually implementing argv of the executable.
"""
More information about the pypy-commit
mailing list