[pypy-svn] r14377 - pypy/dist/pypy/annotation
quest at codespeak.net
quest at codespeak.net
Thu Jul 7 15:05:26 CEST 2005
Author: quest
Date: Thu Jul 7 15:05:25 2005
New Revision: 14377
Modified:
pypy/dist/pypy/annotation/policy.py
Log:
More legible error messages from annotation of specialize and override.
Modified: pypy/dist/pypy/annotation/policy.py
==============================================================================
--- pypy/dist/pypy/annotation/policy.py (original)
+++ pypy/dist/pypy/annotation/policy.py Thu Jul 7 15:05:25 2005
@@ -38,7 +38,12 @@
try:
specialize = getattr(pol, 'specialize__%s' % tag)
except AttributeError:
- raise AttributeError, "%s specialize tag found in user program but not defined in annotation policy %s" % (tag, pol)
+ raise AttributeError("%s specialize tag found in callable %r "
+ "(file %s:%d) but not defined in annotation "
+ "policy %s" % (tag, func.func_name,
+ func.func_code.co_filename,
+ func.func_code.co_firstlineno,
+ pol))
return specialize(bookkeeper, mod, spaceop, func, args, mono)
@@ -49,7 +54,12 @@
try:
override = getattr(pol, 'override__%s' % override_tag)
except AttributeError:
- raise AttributeError, "'override:%s' found in user program but not defined in annotation policy %s" % (override_tag, pol)
+ raise AttributeError("'override:%s' found in callable %r "
+ "(file %s:%d) but not defined in annotation "
+ "policy %s" % (override_tag, func.func_name,
+ func.func_code.co_filename,
+ func.func_code.co_firstlineno ,
+ pol))
inputcells = bookkeeper.get_inputcells(func, args)
r = override(*inputcells)
More information about the Pypy-commit
mailing list