summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/hstore.py
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2021-10-30 22:00:25 +0200
committerMike Bayer <mike_mp@zzzcomputing.com>2021-11-01 15:11:25 -0400
commit36e7aebd8d6faac77570403e99f9aa7b2330fa59 (patch)
treef45950f61a4b27f128518be52157021ca4f4e8f7 /lib/sqlalchemy/dialects/postgresql/hstore.py
parenta99ea884403de1e1f762e9b1eb635d7fc6ef8e6f (diff)
downloadsqlalchemy-36e7aebd8d6faac77570403e99f9aa7b2330fa59.tar.gz
First round of removal of python 2
References: #4600 Change-Id: I61e35bc93fe95610ae75b31c18a3282558cd4ffe
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/hstore.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/hstore.py42
1 files changed, 10 insertions, 32 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/hstore.py b/lib/sqlalchemy/dialects/postgresql/hstore.py
index a4090f1ac..85d678ef5 100644
--- a/lib/sqlalchemy/dialects/postgresql/hstore.py
+++ b/lib/sqlalchemy/dialects/postgresql/hstore.py
@@ -228,42 +228,20 @@ class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine):
comparator_factory = Comparator
def bind_processor(self, dialect):
- if util.py2k:
- encoding = dialect.encoding
-
- def process(value):
- if isinstance(value, dict):
- return _serialize_hstore(value).encode(encoding)
- else:
- return value
-
- else:
-
- def process(value):
- if isinstance(value, dict):
- return _serialize_hstore(value)
- else:
- return value
+ def process(value):
+ if isinstance(value, dict):
+ return _serialize_hstore(value)
+ else:
+ return value
return process
def result_processor(self, dialect, coltype):
- if util.py2k:
- encoding = dialect.encoding
-
- def process(value):
- if value is not None:
- return _parse_hstore(value.decode(encoding))
- else:
- return value
-
- else:
-
- def process(value):
- if value is not None:
- return _parse_hstore(value)
- else:
- return value
+ def process(value):
+ if value is not None:
+ return _parse_hstore(value)
+ else:
+ return value
return process