Author: Armin Rigo <[email protected]>
Branch:
Changeset: r45037:c94f896f267f
Date: 2011-06-21 18:40 +0200
http://bitbucket.org/pypy/pypy/changeset/c94f896f267f/
Log: Add a clear error message when we specify the wrong file as an
argument to 'translate.py'.
diff --git a/pypy/translator/goal/translate.py
b/pypy/translator/goal/translate.py
--- a/pypy/translator/goal/translate.py
+++ b/pypy/translator/goal/translate.py
@@ -103,6 +103,8 @@
specname = os.path.splitext(os.path.basename(targetspec))[0]
sys.path.insert(0, os.path.dirname(targetspec))
mod = __import__(specname)
+ if 'target' not in mod.__dict__:
+ raise Exception("file %r is not a valid targetxxx.py." % (targetspec,))
return mod.__dict__
def parse_options_and_load_target():
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit