[pypy-svn] r12276 - pypy/dist/goal

tismer at codespeak.net tismer at codespeak.net
Sun May 15 02:32:02 CEST 2005


Author: tismer
Date: Sun May 15 02:32:02 2005
New Revision: 12276

Modified:
   pypy/dist/goal/translate_pypy.py
Log:
for convenience, targetspec may or may not specify .py
(useful for tabbing)

Modified: pypy/dist/goal/translate_pypy.py
==============================================================================
--- pypy/dist/goal/translate_pypy.py	(original)
+++ pypy/dist/goal/translate_pypy.py	Sun May 15 02:32:02 2005
@@ -10,7 +10,7 @@
               targetspec.py is a python file defining
               what is the translation target and setting things up for it,
               it should have a target function returning an entry_point ...;
-              defaults to targetpypy
+              defaults to targetpypy. The .py suffix is optional.
    -text      Don't start the Pygame viewer
    -no-a      Don't infer annotations, just translate everything
    -no-s      Don't simplify the graph after annotation
@@ -198,7 +198,11 @@
             listen_port = int(arg)
         except ValueError:
             if os.path.isfile(arg+'.py'):
+                assert not os.path.isfile(arg), (
+                    "ambiguous file naming, please rename %s" % arg)
                 targetspec = arg
+            elif os.path.isfile(arg) and arg.endswith('.py'):
+                targetspec = arg[:-3]
             elif arg.startswith('-huge='):
                 huge = int(arg[6:])
             else:                



More information about the Pypy-commit mailing list