summaryrefslogtreecommitdiff
path: root/sqlparse/__init__.py
diff options
context:
space:
mode:
authorOleg Broytman <phd@phdru.name>2016-08-29 21:36:15 +0300
committerOleg Broytman <phd@phdru.name>2016-08-31 16:09:36 +0300
commitb05bc5ab586cb06d89c38e2eee7f77e1d3fc03c5 (patch)
tree2510e36ffc9f911032ade6de88a62bffa51d37b8 /sqlparse/__init__.py
parent791a3312a247670cdeed61e52e8ca449dbb27afa (diff)
downloadsqlparse-b05bc5ab586cb06d89c38e2eee7f77e1d3fc03c5.tar.gz
Convert string literals to unicode for Py27
Working with non-ascii in Python require all-unicode approach, but str literals in Python 2.7 are bytes. The patch makes them unicode. Syntax u'' is supported in Python 2.7 and 3.3+.
Diffstat (limited to 'sqlparse/__init__.py')
-rw-r--r--sqlparse/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sqlparse/__init__.py b/sqlparse/__init__.py
index b5b8435..8aef5b1 100644
--- a/sqlparse/__init__.py
+++ b/sqlparse/__init__.py
@@ -57,7 +57,7 @@ def format(sql, encoding=None, **options):
options = formatter.validate_options(options)
stack = formatter.build_filter_stack(stack, options)
stack.postprocess.append(filters.SerializerUnicode())
- return ''.join(stack.run(sql, encoding))
+ return u''.join(stack.run(sql, encoding))
def split(sql, encoding=None):