changeset 108:9f212bdf4c5d

Prefer hasattr to direct __dict__ access.
author Martin Geisler <mg@lazybytes.net>
date Fri, 17 Jul 2009 11:53:56 +0200
parents 12f0d470f970
children 60e3bf58f227
files pysmcl/flow.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/flow.py	Fri Jul 17 11:52:36 2009 +0200
+++ b/pysmcl/flow.py	Fri Jul 17 11:53:56 2009 +0200
@@ -50,7 +50,7 @@
         Prepares all statements under node for further analysis.
         """
         for child in ast.walk(node):
-            if "initialized" in child.__dict__:
+            if hasattr(child, "initialized"):
                 continue
             if(isinstance(child, ast.stmt)):
                 # children and parents are used for flow-graph edges