forked from hans/Nominatim
nominatim.py: use async in connect() function
The _async parameter name is only supported since psycopg 2.7. However, async is a keyword in Python >= 3.7, so using this gives us a syntax error. Working around this by defining the parameters in a dict and handing that into the connect function.
This commit is contained in:
@@ -35,9 +35,14 @@ import select
|
|||||||
log = logging.getLogger()
|
log = logging.getLogger()
|
||||||
|
|
||||||
def make_connection(options, asynchronous=False):
|
def make_connection(options, asynchronous=False):
|
||||||
return psycopg2.connect(dbname=options.dbname, user=options.user,
|
params = {'dbname' : options.dbname,
|
||||||
password=options.password, host=options.host,
|
'user' : options.user,
|
||||||
port=options.port, async_=asynchronous)
|
'password' : options.password,
|
||||||
|
'host' : options.host,
|
||||||
|
'port' : options.port,
|
||||||
|
'async' : asynchronous}
|
||||||
|
|
||||||
|
return psycopg2.connect(**params)
|
||||||
|
|
||||||
|
|
||||||
class RankRunner(object):
|
class RankRunner(object):
|
||||||
|
|||||||
Reference in New Issue
Block a user