[pypy-svn] r37307 - pypy/dist/pypy/annotation

ac at codespeak.net ac at codespeak.net
Wed Jan 24 23:23:50 CET 2007


Author: ac
Date: Wed Jan 24 23:23:49 2007
New Revision: 37307

Modified:
   pypy/dist/pypy/annotation/classdef.py
Log:
(arre, pedronis)

fix interaction of __slots__ enforced attributes and prebuilt instances missing them



Modified: pypy/dist/pypy/annotation/classdef.py
==============================================================================
--- pypy/dist/pypy/annotation/classdef.py	(original)
+++ pypy/dist/pypy/annotation/classdef.py	Wed Jan 24 23:23:49 2007
@@ -416,7 +416,14 @@
         self.obj = obj
  
     def s_get_value(self, classdef, name):
-        s_value = self.bookkeeper.immutablevalue(getattr(self.obj, name))
+        try:
+            v = getattr(self.obj, name)
+        except AttributeError:
+            allslots = classdef.classdesc.allslots
+            if allslots and name in allslots:
+                return s_ImpossibleValue
+            raise
+        s_value = self.bookkeeper.immutablevalue(v)
         return s_value
 
     def all_instance_attributes(self):


More information about the pypy-svn mailing list