[Python-checkins] r68694 - sandbox/trunk/2to3/lib2to3/fixes/fix_except.py

benjamin.peterson python-checkins at python.org
Sun Jan 18 00:56:00 CET 2009


Author: benjamin.peterson
Date: Sun Jan 18 00:55:59 2009
New Revision: 68694

Log:
test for specific node type

Modified:
   sandbox/trunk/2to3/lib2to3/fixes/fix_except.py

Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_except.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/fixes/fix_except.py	(original)
+++ sandbox/trunk/2to3/lib2to3/fixes/fix_except.py	Sun Jan 18 00:55:59 2009
@@ -25,11 +25,11 @@
 from .. import pytree
 from ..pgen2 import token
 from .. import fixer_base
-from ..fixer_util import Assign, Attr, Name, is_tuple, is_list
+from ..fixer_util import Assign, Attr, Name, is_tuple, is_list, syms
 
 def find_excepts(nodes):
     for i, n in enumerate(nodes):
-        if isinstance(n, pytree.Node):
+        if n.type == syms.except_clause:
             if n.children[0].value == 'except':
                 yield (n, nodes[i+2])
 


More information about the Python-checkins mailing list