bugfix
This commit is contained in:
parent
4bac4349bf
commit
66c7d33e0a
@ -234,18 +234,22 @@ class DBPools:
|
|||||||
driver = myImport(dbdesc['driver'])
|
driver = myImport(dbdesc['driver'])
|
||||||
conn = None
|
conn = None
|
||||||
cur = None
|
cur = None
|
||||||
|
desc = dbdesc['kwargs'].copy()
|
||||||
|
pw = desc.get('password')
|
||||||
|
if pw:
|
||||||
|
desc['password'] = unpassword(pw)
|
||||||
if self.isAsyncDriver(dbname):
|
if self.isAsyncDriver(dbname):
|
||||||
if dbdesc['driver'] == 'sqlite3':
|
if dbdesc['driver'] == 'sqlite3':
|
||||||
conn = await driver.connect(dbdesc['kwargs']['dbname'])
|
conn = await driver.connect(desc['dbname'])
|
||||||
else:
|
else:
|
||||||
conn = await driver.connect(**dbdesc['kwargs'])
|
conn = await driver.connect(**desc)
|
||||||
cur = await conn.cursor()
|
cur = await conn.cursor()
|
||||||
return True,conn,cur
|
return True,conn,cur
|
||||||
else:
|
else:
|
||||||
if dbdesc['driver'] == 'sqlite3':
|
if dbdesc['driver'] == 'sqlite3':
|
||||||
conn = driver.connect(dbdesc['kwargs']['dbname'])
|
conn = driver.connect(desc['dbname'])
|
||||||
else:
|
else:
|
||||||
conn = driver.connect(**dbdesc['kwargs'])
|
conn = driver.connect(**desc)
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
return False,conn,cur
|
return False,conn,cur
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user