summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mssql/pymssql.py
diff options
context:
space:
mode:
authorMarc Abramowitz <marc@marc-abramowitz.com>2013-03-18 13:43:46 -0700
committerMarc Abramowitz <marc@marc-abramowitz.com>2013-03-18 13:43:46 -0700
commit40b99602c66c1315826451357454fecf6b83d28b (patch)
tree589a8c1e71cd2a688801817fd641993e7f7be759 /lib/sqlalchemy/dialects/mssql/pymssql.py
parentc97889af6db7b4fd3d3b5986f4bcb1588fabe750 (diff)
downloadsqlalchemy-40b99602c66c1315826451357454fecf6b83d28b.tar.gz
dialects/mssql/pymssql.py: Modify module.Binary to work properly with
byte strings in Python 3 Fixes http://www.sqlalchemy.org/trac/ticket/2683
Diffstat (limited to 'lib/sqlalchemy/dialects/mssql/pymssql.py')
-rw-r--r--lib/sqlalchemy/dialects/mssql/pymssql.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/pymssql.py b/lib/sqlalchemy/dialects/mssql/pymssql.py
index 6f6d3b01f..c86ebefb3 100644
--- a/lib/sqlalchemy/dialects/mssql/pymssql.py
+++ b/lib/sqlalchemy/dialects/mssql/pymssql.py
@@ -54,7 +54,7 @@ class MSDialect_pymssql(MSDialect):
module = __import__('pymssql')
# pymmsql doesn't have a Binary method. we use string
# TODO: monkeypatching here is less than ideal
- module.Binary = str
+ module.Binary = lambda x: x if hasattr(x, 'decode') else str(x)
client_ver = tuple(int(x) for x in module.__version__.split("."))
if client_ver < (1, ):