summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorGaëtan de Menten <gdementen@gmail.com>2009-11-17 18:28:13 +0000
committerGaëtan de Menten <gdementen@gmail.com>2009-11-17 18:28:13 +0000
commitf96130aceffd4f69dd5ce4a1afaddd6f7f209cf7 (patch)
tree5d03733e7e60b0baf9a9afab7730fdb0310b924e /lib/sqlalchemy
parent6f96478e76ad8d2bef0466f31873c107dc7c4fb8 (diff)
downloadsqlalchemy-f96130aceffd4f69dd5ce4a1afaddd6f7f209cf7.tar.gz
minor speed optimization in String result_processor (if decoding is required)
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/types.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py
index 62dd6dfc7..137b580c6 100644
--- a/lib/sqlalchemy/types.py
+++ b/lib/sqlalchemy/types.py
@@ -530,9 +530,10 @@ class String(Concatenable, TypeEngine):
if needs_convert:
# note we *assume* that we do not have a unicode object
# here, instead of an expensive isinstance() check.
+ encoding = dialect.encoding
def process(value):
if value is not None:
- return value.decode(dialect.encoding)
+ return value.decode(encoding)
else:
return value
return process