[pypy-commit] pypy default: catch AnnotatorError one level higher
rlamy
noreply at buildbot.pypy.org
Fri May 16 05:15:29 CEST 2014
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch:
Changeset: r71537:16300e5795a1
Date: 2014-05-16 04:14 +0100
http://bitbucket.org/pypy/pypy/changeset/16300e5795a1/
Log: catch AnnotatorError one level higher
diff --git a/rpython/annotator/annrpython.py b/rpython/annotator/annrpython.py
--- a/rpython/annotator/annrpython.py
+++ b/rpython/annotator/annrpython.py
@@ -433,6 +433,10 @@
except annmodel.HarmlesslyBlocked:
return
+ except annmodel.AnnotatorError as e: # note that UnionError is a subclass
+ e.source = gather_error(self, graph, block, i)
+ raise
+
else:
# dead code removal: don't follow all exits if the exitswitch
# is known
@@ -580,23 +584,18 @@
def consider_op(self, block, opindex):
op = block.operations[opindex]
- try:
- argcells = [self.binding(a) for a in op.args]
+ argcells = [self.binding(a) for a in op.args]
- # let's be careful about avoiding propagated SomeImpossibleValues
- # to enter an op; the latter can result in violations of the
- # more general results invariant: e.g. if SomeImpossibleValue enters is_
- # is_(SomeImpossibleValue, None) -> SomeBool
- # is_(SomeInstance(not None), None) -> SomeBool(const=False) ...
- # boom -- in the assert of setbinding()
- for arg in argcells:
- if isinstance(arg, annmodel.SomeImpossibleValue):
- raise BlockedInference(self, op, opindex)
- resultcell = op.consider(self, *argcells)
- except annmodel.AnnotatorError as e: # note that UnionError is a subclass
- graph = self.bookkeeper.position_key[0]
- e.source = gather_error(self, graph, block, opindex)
- raise
+ # let's be careful about avoiding propagated SomeImpossibleValues
+ # to enter an op; the latter can result in violations of the
+ # more general results invariant: e.g. if SomeImpossibleValue enters is_
+ # is_(SomeImpossibleValue, None) -> SomeBool
+ # is_(SomeInstance(not None), None) -> SomeBool(const=False) ...
+ # boom -- in the assert of setbinding()
+ for arg in argcells:
+ if isinstance(arg, annmodel.SomeImpossibleValue):
+ raise BlockedInference(self, op, opindex)
+ resultcell = op.consider(self, *argcells)
if resultcell is None:
resultcell = annmodel.s_ImpossibleValue
elif resultcell == annmodel.s_ImpossibleValue:
More information about the pypy-commit
mailing list