Commits

Carl Friedrich Bolz committed cf4c83c

make it possible to have the target return just the main function, which is by
far the most common case nowadays.

  • Participants
  • Parent commits 27316db

Comments (0)

Files changed (3)

rpython/translator/driver.py

 
         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,

rpython/translator/goal/targetnopstandalone.py

 # _____ Define and setup target ___
 
 def target(*args):
-    return entry_point, None
+    return entry_point

rpython/translator/goal/targetrpystonedalone.py

 # _____ 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.
 """