[pypy-svn] r7556 - pypy/trunk/src/pypy/translator
arigo at codespeak.net
arigo at codespeak.net
Mon Nov 22 13:43:20 CET 2004
Author: arigo
Date: Mon Nov 22 13:43:19 2004
New Revision: 7556
Modified:
pypy/trunk/src/pypy/translator/simplify.py
Log:
Detect again a case for simplification of implicit exceptions that was broken
by the previous reorganization.
Modified: pypy/trunk/src/pypy/translator/simplify.py
==============================================================================
--- pypy/trunk/src/pypy/translator/simplify.py (original)
+++ pypy/trunk/src/pypy/translator/simplify.py Mon Nov 22 13:43:19 2004
@@ -73,8 +73,10 @@
link.prevblock.exitswitch == Constant(last_exception) and
isinstance(link.exitcase, type(Exception)) and
issubclass(link.exitcase, Exception) and
- list(link.args) == [Constant(last_exception),
- Constant(last_exc_value)]):
+ len(link.args) == 2 and
+ link.args[1] == Constant(last_exc_value) and
+ link.args[0] in [Constant(last_exception),
+ Constant(link.exitcase)]):
# remove the link
lst = list(link.prevblock.exits)
lst.remove(link)
More information about the Pypy-commit
mailing list