From b05bc5ab586cb06d89c38e2eee7f77e1d3fc03c5 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 29 Aug 2016 21:36:15 +0300 Subject: 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+. --- sqlparse/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sqlparse/__init__.py') 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): -- cgit v1.2.1