Skip to content

Commit

Permalink
Add psycopg3 support
Browse files Browse the repository at this point in the history
Fixes #130
  • Loading branch information
bufke authored Mar 23, 2023
1 parent 03a3579 commit d7ecf94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bitfield/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d7ecf94

Please sign in to comment.