dbapi.py
branchstable
changeset 8744 2091d275fe5c
parent 8702 d47089677d44
child 8934 48a6e6b88b16
child 8983 2a244f90a1e3
--- a/dbapi.py	Wed Mar 20 17:40:25 2013 +0100
+++ b/dbapi.py	Tue Mar 19 18:20:57 2013 +0100
@@ -204,13 +204,13 @@
       there goes authentication tokens. You usually have to specify a password
       for the given user, using a named 'password' argument.
     """
-    if urlparse(database).scheme is None:
+    if not urlparse(database).scheme:
         warn('[3.16] give an qualified URI as database instead of using '
              'host/cnxprops to specify the connection method',
              DeprecationWarning, stacklevel=2)
-        if cnxprops.cnxtype == 'zmq':
+        if cnxprops and cnxprops.cnxtype == 'zmq':
             database = kwargs.pop('host')
-        elif cnxprops.cnxtype == 'inmemory':
+        elif cnxprops and cnxprops.cnxtype == 'inmemory':
             database = 'inmemory://' + database
         else:
             database = 'pyro://%s/%s.%s' % (kwargs.pop('host', ''),