diff options
-rw-r--r-- | lib/sqlalchemy/dialects/oracle/cx_oracle.py | 22 | ||||
-rw-r--r-- | test/dialect/test_oracle.py | 3 |
2 files changed, 13 insertions, 12 deletions
diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py index 99a514776..5b0c3edd7 100644 --- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py +++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py @@ -182,7 +182,7 @@ a period "." as the decimal character. """ - +from __future__ import absolute_import from .base import OracleCompiler, OracleDialect, OracleExecutionContext from . import base as oracle @@ -269,16 +269,16 @@ class _LOBMixin(object): class _NativeUnicodeMixin(object): if util.py2k: - def bind_processor(self, dialect): - if dialect._cx_oracle_with_unicode: - def process(value): - if value is None: - return value - else: - return unicode(value) - return process - else: - return super(_NativeUnicodeMixin, self).bind_processor(dialect) + def bind_processor(self, dialect): + if dialect._cx_oracle_with_unicode: + def process(value): + if value is None: + return value + else: + return unicode(value) + return process + else: + return super(_NativeUnicodeMixin, self).bind_processor(dialect) # we apply a connection output handler that returns # unicode in all cases, so the "native_unicode" flag diff --git a/test/dialect/test_oracle.py b/test/dialect/test_oracle.py index 00bbbcd7c..7c17459d6 100644 --- a/test/dialect/test_oracle.py +++ b/test/dialect/test_oracle.py @@ -8,6 +8,7 @@ from sqlalchemy.sql import table, column from sqlalchemy.testing import fixtures, AssertsExecutionResults, AssertsCompiledSQL from sqlalchemy import testing from sqlalchemy.util import u +from sqlalchemy import util from sqlalchemy.testing import assert_raises, assert_raises_message from sqlalchemy.testing.engines import testing_engine from sqlalchemy.dialects.oracle import cx_oracle, base as oracle @@ -1652,7 +1653,7 @@ class UnicodeSchemaTest(fixtures.TestBase): metadata.create_all() table.insert().execute( - {'_underscorecolumn': '’é'}, + {'_underscorecolumn': u('’é')}, ) result = testing.db.execute( table.select().where(table.c._underscorecolumn==u('’é')) |