# HG changeset patch # User Denis Laxalde # Date 1476284582 -7200 # Node ID dc081e31501e0b63db1fe6d463ffb151ac5b0e6f # Parent 47e5165874603034f51d79277b4c88ef6462be0c [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. diff -r 47e516587460 -r dc081e31501e 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