[session] Allow self._open to be False in __enter__
authorDenis Laxalde <denis.laxalde@logilab.fr>
Wed, 12 Oct 2016 17:03:02 +0200
changeset 11738 dc081e31501e
parent 11737 47e516587460
child 11739 bc864c80ec36
[session] Allow self._open to be False in __enter__ I do not understand why this assertion was there in the first place. And currently, it makes running any migration impossible. Hopefully, someone may be able to explain. See also commit b48020a80dc3 which mentions this assertion and suggests to remove it.
cubicweb/server/session.py
--- a/cubicweb/server/session.py	Fri Oct 21 18:35:46 2016 +0200
+++ b/cubicweb/server/session.py	Wed Oct 12 17:03:02 2016 +0200
@@ -381,7 +381,7 @@
     # life cycle handling ####################################################
 
     def __enter__(self):
-        assert self._open is None  # first opening
+        assert not self._open
         self._open = True
         self.cnxset = self.repo._get_cnxset()
         return self