[dbapi] return default argument instead of None when no connection set yet
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 12 Mar 2010 15:00:54 +0100
changeset 4895 7003912cec86
parent 4894 41c28ddca055
child 4896 45a1c3f0d0d9
[dbapi] return default argument instead of None when no connection set yet
dbapi.py
--- a/dbapi.py	Fri Mar 12 15:00:25 2010 +0100
+++ b/dbapi.py	Fri Mar 12 15:00:54 2010 +0100
@@ -237,7 +237,7 @@
     def get_session_data(self, key, default=None, pop=False):
         """return value associated to `key` in session data"""
         if self.cnx is None:
-            return None # before the connection has been established
+            return default # before the connection has been established
         return self.cnx.get_session_data(key, default, pop)
 
     def set_session_data(self, key, value):