Author: Ronan Lamy <[email protected]>
Branch:
Changeset: r83754:144d46bb01e4
Date: 2016-04-19 00:48 +0100
http://bitbucket.org/pypy/pypy/changeset/144d46bb01e4/
Log: fix annotation error reporting for stat_result.__getitem__
diff --git a/rpython/rlib/rposix_stat.py b/rpython/rlib/rposix_stat.py
--- a/rpython/rlib/rposix_stat.py
+++ b/rpython/rlib/rposix_stat.py
@@ -94,7 +94,8 @@
return self.__class__,
def getattr(self, s_attr):
- assert s_attr.is_constant(), "non-constant attr name in getattr()"
+ if not s_attr.is_constant():
+ raise annmodel.AnnotatorError("non-constant attr name in
getattr()")
attrname = s_attr.const
TYPE = STAT_FIELD_TYPES[attrname]
return lltype_to_annotation(TYPE)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit