dbapi.py
branchstable
changeset 8983 2a244f90a1e3
parent 8744 2091d275fe5c
child 8992 55a1567d92a0
--- a/dbapi.py	Thu May 23 12:35:02 2013 +0200
+++ b/dbapi.py	Tue May 14 18:02:24 2013 +0200
@@ -213,9 +213,13 @@
         elif cnxprops and cnxprops.cnxtype == 'inmemory':
             database = 'inmemory://' + database
         else:
-            database = 'pyro://%s/%s.%s' % (kwargs.pop('host', ''),
-                                            kwargs.pop('group', 'cubicweb'),
-                                            database)
+            host = kwargs.pop('host', None)
+            if host is None:
+                host = ''
+            group = kwargs.pop('group', None)
+            if group is None:
+                group = 'cubicweb'
+            database = 'pyro://%s/%s.%s' % (host, group, database)
     puri = urlparse(database)
     method = puri.scheme.lower()
     if method == 'inmemory':