Skip to content

Commit d7ecf94

Browse files
authored
Add psycopg3 support
Fixes #130
1 parent 03a3579 commit d7ecf94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bitfield/types.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -260,5 +260,6 @@ def get_label(self, flag):
260260
from django.db.backends.postgresql.base import Database
261261
Database.extensions.register_adapter(Bit, lambda x: Database.extensions.AsIs(int(x)))
262262
Database.extensions.register_adapter(BitHandler, lambda x: Database.extensions.AsIs(int(x)))
263-
except ImproperlyConfigured:
263+
# Ignore in psycopg3 where there is no Database.extensions nor any need to adapt types
264+
except (ImproperlyConfigured, AttributeError):
264265
pass

0 commit comments

Comments
 (0)