[pypy-svn] r17377 - pypy/dist/pypy/interpreter/astcompiler

pedronis at codespeak.net pedronis at codespeak.net
Thu Sep 8 17:52:10 CEST 2005


Author: pedronis
Date: Thu Sep  8 17:52:09 2005
New Revision: 17377

Modified:
   pypy/dist/pypy/interpreter/astcompiler/pycodegen.py
Log:
make this RPython



Modified: pypy/dist/pypy/interpreter/astcompiler/pycodegen.py
==============================================================================
--- pypy/dist/pypy/interpreter/astcompiler/pycodegen.py	(original)
+++ pypy/dist/pypy/interpreter/astcompiler/pycodegen.py	Thu Sep  8 17:52:09 2005
@@ -142,6 +142,8 @@
     __init__() defined in this class.
     """
 
+    graph = None
+
     optimized = 0 # is namespace access optimized?
     __initialized = None
     class_name = None # provide default for instance variable
@@ -165,12 +167,7 @@
 
     def checkClass(self):
         """Verify that class is constructed correctly"""
-        try:
-            assert hasattr(self, 'graph')
-        except AssertionError, msg:
-            intro = "Bad class construction for %s" % self.__class__.__name__
-            raise AssertionError, intro
-
+        assert self.graph is not None, "bad class construction for %r" % self
 
     def emit(self, inst ):
         return self.graph.emit( inst )



More information about the Pypy-commit mailing list