[Zodb-checkins] CVS: Zope3/lib/python/Persistence - _persistent.py:1.1.2.7

Jeremy Hylton jeremy@zope.com
Sat, 1 Dec 2001 23:19:11 -0500


Update of /cvs-repository/Zope3/lib/python/Persistence
In directory cvs.zope.org:/tmp/cvs-serv5060

Modified Files:
      Tag: Zope-3x-branch
	_persistent.py 
Log Message:
In a couple places, use _p_state directly rather than creatie a temporary.






=== Zope3/lib/python/Persistence/_persistent.py 1.1.2.6 => 1.1.2.7 ===
 
     def _p_deactivate(self):
-        state=self._p_state
-        if state:
+        if self._p_state:
             return
         if self._p_jar is None or self._p_oid is None:
             return
@@ -93,15 +92,14 @@
 
     def __setattr__(self, name, v):
         if name[:3] not in ('_p_', '_v_') and name != '__dict__':
-            state=self._p_state
-            if state is None:
+            if self._p_state is None:
                 dm=self._p_jar
                 if dm is None or self._p_oid is None:
                     raise TypeError('Attempt to modify a unreviveable ghost')
                 # revivable ghost
                 setstate(self, dm, 1)
                 dm.register(self)
-            elif not state:
+            elif not self._p_state:
                 dm=self._p_jar
                 if dm is not None:
                     self._p_state = 1