diff --git a/bitfield/types.py b/bitfield/types.py index d7f6d8f..84ac604 100644 --- a/bitfield/types.py +++ b/bitfield/types.py @@ -260,5 +260,6 @@ def get_label(self, flag): from django.db.backends.postgresql.base import Database Database.extensions.register_adapter(Bit, lambda x: Database.extensions.AsIs(int(x))) Database.extensions.register_adapter(BitHandler, lambda x: Database.extensions.AsIs(int(x))) -except ImproperlyConfigured: +# Ignore in psycopg3 where there is no Database.extensions nor any need to adapt types +except (ImproperlyConfigured, AttributeError): pass