From 2ebfbd894e21e1656c1e1f32d98b8df7a32d3649 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Mon, 12 Dec 2022 08:25:05 +0100 Subject: Refs #33308 -- Moved psycopg2 imports to the psycopg_any module. --- django/db/backends/postgresql/schema.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'django/db/backends/postgresql/schema.py') diff --git a/django/db/backends/postgresql/schema.py b/django/db/backends/postgresql/schema.py index 68c5bf31af..0c2043db35 100644 --- a/django/db/backends/postgresql/schema.py +++ b/django/db/backends/postgresql/schema.py @@ -1,7 +1,6 @@ -import psycopg2 - from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.backends.ddl_references import IndexColumns +from django.db.backends.postgresql.psycopg_any import extensions from django.db.backends.utils import strip_quotes @@ -52,7 +51,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): def quote_value(self, value): if isinstance(value, str): value = value.replace("%", "%%") - adapted = psycopg2.extensions.adapt(value) + adapted = extensions.adapt(value) if hasattr(adapted, "encoding"): adapted.encoding = "utf8" # getquoted() returns a quoted bytestring of the adapted value. -- cgit v1.2.1