[Zope-Checkins] CVS: Zope3/lib/python/Persistence - _persistent.py:

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
Log Message:
In a couple places, use _p_state directly rather than creatie a temporary.

=== Zope3/lib/python/Persistence/_persistent.py => ===
     def _p_deactivate(self):
-        state=self._p_state
-        if state:
+        if self._p_state:
         if self._p_jar is None or self._p_oid is None:
@@ -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:
                 if dm is None or self._p_oid is None:
                     raise TypeError('Attempt to modify a unreviveable ghost')
                 # revivable ghost
                 setstate(self, dm, 1)
-            elif not state:
+            elif not self._p_state:
                 if dm is not None:
                     self._p_state = 1