Skip to content

Commit 9caff9a

Browse files
committed
Apply DB-API 2.0 exception correction.
1 parent 1e14468 commit 9caff9a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Changes in v1.3
2+
===============
3+
4+
1.3.0
5+
-----
6+
7+
* Commit DB-API 2.0 ClientCannotConnect exception correction.

postgresql/driver/dbapi20.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ class Connection(Connection):
325325
NotSupportedError = NotSupportedError
326326

327327
# Explicitly manage DB-API connected state to properly
328-
# throw the already closed error. This will be active in 1.3.
328+
# throw the already closed error.
329329
_dbapi_connected_flag = False
330330

331331
def autocommit_set(self, val):
@@ -361,7 +361,7 @@ def connect(self, *args, **kw):
361361
self._dbapi_connected_flag = True
362362

363363
def close(self):
364-
if self.closed:# and self._dbapi_connected_flag:
364+
if self.closed and self._dbapi_connected_flag:
365365
raise Error(
366366
"connection already closed",
367367
source = 'CLIENT',

0 commit comments

Comments
 (0)