Add a "closed" property on session stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 08 Mar 2011 17:55:15 +0100
branchstable
changeset 7054 c8f12ab250b7
parent 7053 0673419b3066
child 7055 a393ebb880cd
Add a "closed" property on session This will simplify check and allow nicer error thatn the current "no _tx_data" attribute error.
server/session.py
--- a/server/session.py	Tue Mar 08 17:55:02 2011 +0100
+++ b/server/session.py	Tue Mar 08 17:55:15 2011 +0100
@@ -854,6 +854,10 @@
         del self.__threaddata
         del self._tx_data
 
+    @property
+    def closed(self):
+        return not hasattr(self, '_tx_data')
+
     # transaction data/operations management ##################################
 
     @property