[pypy-commit] pypy stm-gc: Better to get an explicit KeyError

arigo noreply at buildbot.pypy.org
Thu Feb 16 12:28:38 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r52547:3f3e5fbbe0a8
Date: 2012-02-16 12:28 +0100
http://bitbucket.org/pypy/pypy/changeset/3f3e5fbbe0a8/

Log:	Better to get an explicit KeyError

diff --git a/pypy/translator/stm/gcsource.py b/pypy/translator/stm/gcsource.py
--- a/pypy/translator/stm/gcsource.py
+++ b/pypy/translator/stm/gcsource.py
@@ -96,7 +96,9 @@
         pending = [variable]
         seen = set(pending)
         for v2 in pending:
-            for v1 in self._backmapping.get(v2, ()):
+            # we get a KeyError here if 'variable' is not found,
+            # or if one of the preceeding variables is not found
+            for v1 in self._backmapping[v2]:
                 if isinstance(v1, Variable):
                     if v1 not in seen:
                         seen.add(v1)


More information about the pypy-commit mailing list