[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pypy-svn
Subject:    [pypy-commit] pypy default: make it possible to have the target return just the main function, which
From:       cfbolz <noreply () buildbot ! pypy ! org>
Date:       2013-07-31 11:42:08
Message-ID: 20130731114208.4C7F81C029A () cobra ! cs ! uni-duesseldorf ! de
[Download RAW message or body]

Author: Carl Friedrich Bolz <cfbolz@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.
 """
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic