Skip to content

Commit a8df018

Browse files
author
James William Pye
committed
Ignore the exception if terminate_backends does not exist.
1 parent b86170c commit a8df018

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

postgresql/temporal.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ def incontext(*args, **kw):
5959
def destroy(self):
6060
# Don't destroy if it's not the initializing process.
6161
if os.getpid() == self._init_pid_:
62-
with self:
63-
# Kill all the open connections.
64-
try:
62+
# Kill all the open connections.
63+
try:
64+
with self:
6565
db.sys.terminate_backends()
66-
except Exception:
67-
pass
66+
except Exception:
67+
# Doesn't matter much if it fails.
68+
pass
6869
cluster = self.cluster
6970
self.cluster = None
7071
self._init_pid_ = None

0 commit comments

Comments
 (0)