]> git.ipfire.org Git - thirdparty/psycopg.git/commit
refactor: clearer cancel_safe implementation
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 10 Apr 2024 20:37:24 +0000 (22:37 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 12 Apr 2024 22:10:44 +0000 (00:10 +0200)
commit0bbbe4bf02a391589c65e88601f9474191d786bd
tree159b7ebc0bf77bce5b9f1b6216d717a1aa82a5d4
parent46f661dbbc30808d11a71c0ae7bbfc8245b6fd42
refactor: clearer cancel_safe implementation

Avoid catching NotSupported, just check for the libpq version.

Also avoid the half exception handler in `_cancel_gen()`: as in the
legacy branch, warn and ignore any error happening in the outermost
method, without adding an ignore exception policy in an implementation
method.

Close #778.
psycopg/psycopg/_connection_base.py
psycopg/psycopg/connection.py
psycopg/psycopg/connection_async.py