diff options
author | Oleksandr Shulgin <oleksandr.shulgin@zalando.de> | 2015-10-15 18:01:43 +0200 |
---|---|---|
committer | Oleksandr Shulgin <oleksandr.shulgin@zalando.de> | 2015-10-15 18:01:43 +0200 |
commit | cf4f2411bfd2d5a1cb84393f135e48107428137b (patch) | |
tree | fddb342b5802aa76fe70784a753d59726e88eeef /lib/extras.py | |
parent | d14fea31a33488a1f62a45a8a87109d5be678a72 (diff) | |
download | psycopg2-cf4f2411bfd2d5a1cb84393f135e48107428137b.tar.gz |
Fix async replication and test.
Diffstat (limited to 'lib/extras.py')
-rw-r--r-- | lib/extras.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/extras.py b/lib/extras.py index f411a4d..dc2d5e6 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -449,7 +449,7 @@ class ReplicationConnectionBase(_connection): classes. Uses `ReplicationCursor` automatically. """ - def __init__(self, dsn, **kwargs): + def __init__(self, *args, **kwargs): """ Initializes a replication connection by adding appropriate parameters to the provided DSN and tweaking the connection @@ -466,7 +466,7 @@ class ReplicationConnectionBase(_connection): else: raise psycopg2.ProgrammingError("unrecognized replication type: %s" % self.replication_type) - items = _ext.parse_dsn(dsn) + items = _ext.parse_dsn(args[0]) # we add an appropriate replication keyword parameter, unless # user has specified one explicitly in the DSN @@ -475,7 +475,8 @@ class ReplicationConnectionBase(_connection): dsn = " ".join(["%s=%s" % (k, psycopg2._param_escape(str(v))) for (k, v) in items.iteritems()]) - super(ReplicationConnectionBase, self).__init__(dsn, **kwargs) + args = [dsn] + list(args[1:]) # async is the possible 2nd arg + super(ReplicationConnectionBase, self).__init__(*args, **kwargs) # prevent auto-issued BEGIN statements if not self.async: |