We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7291e4 commit 25a1e9dCopy full SHA for 25a1e9d
1 file changed
scripts/osm2pgsql-replication
@@ -33,9 +33,12 @@ import urllib.request as urlrequest
33
missing_modules = []
34
35
try:
36
- import psycopg2
+ import psycopg2 as psycopg
37
except ImportError:
38
- missing_modules.append('psycopg2')
+ try:
39
+ import psycopg
40
+ except ImportError:
41
+ missing_modules.append('psycopg2')
42
43
44
from osmium.replication.server import ReplicationServer
@@ -72,8 +75,8 @@ def pretty_format_timedelta(seconds):
72
75
def connect(args):
73
76
""" Create a connection from the given command line arguments.
74
77
"""
- return psycopg2.connect(dbname=args.database, user=args.username,
- host=args.host, port=args.port)
78
+ return psycopg.connect(dbname=args.database, user=args.username,
79
+ host=args.host, port=args.port)
80
81
82
def compute_database_date(conn, prefix):
0 commit comments