diff options
Diffstat (limited to 'sqlparse/utils.py')
| -rw-r--r-- | sqlparse/utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sqlparse/utils.py b/sqlparse/utils.py index 8253e0b..4a8646d 100644 --- a/sqlparse/utils.py +++ b/sqlparse/utils.py @@ -9,6 +9,7 @@ import itertools import re from collections import deque from contextlib import contextmanager +from sqlparse.compat import text_type # This regular expression replaces the home-cooked parser that was here before. # It is much faster, but requires an extra post-processing step to get the @@ -33,11 +34,12 @@ SPLIT_REGEX = re.compile(r""" LINE_MATCH = re.compile(r'(\r\n|\r|\n)') -def split_unquoted_newlines(text): +def split_unquoted_newlines(stmt): """Split a string on all unquoted newlines. Unlike str.splitlines(), this will ignore CR/LF/CR+LF if the requisite character is inside of a string.""" + text = text_type(stmt) lines = SPLIT_REGEX.split(text) outputlines = [''] for line in lines: |
