Skip to content

Commit 148d5f5

Browse files
author
James William Pye
committed
Emit deprecation warnings when gid/two phase is used.
1 parent b94a52a commit 148d5f5

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

postgresql/documentation/changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Changes
99
* Add support for DOMAINs in registered composites. (Elvis Pranskevichus)
1010
* Properly raise StopIteration in Cursor.__next__ (Elvis Pranskevichus)
1111
* Fix Startup() usage for Python 3.2.
12+
* Emit deprecation warning when 'gid' is given to xact().
1213

1314
1.0.1 released on 2010-04-24
1415
----------------------------

postgresql/driver/pq3.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
from ..types import io as pg_types_io
4444
from ..types.io import lib as io_lib
4545

46+
import warnings
47+
4648
# Map element3.Notice field identifiers
4749
# to names used by message.Message.
4850
notice_field_to_name = {
@@ -2044,6 +2046,9 @@ def _e_metas(self):
20442046
def __init__(self, database, isolation = None, mode = None, gid = None):
20452047
self.database = database
20462048
self.gid = gid
2049+
if gid is not None:
2050+
# XXX: remove in 1.1
2051+
warnings.warn("two phase interfaces will not exist in 1.1; do not use the 'gid' parameter", DeprecationWarning, stacklevel=3)
20472052
self.isolation = isolation
20482053
self.mode = mode
20492054
self.state = 'initialized'

0 commit comments

Comments
 (0)