diff options
| author | Vik <vmuriart@gmail.com> | 2016-06-12 13:09:56 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-12 13:09:56 -0700 |
| commit | 8ad44059d4d9ab5a8a7489a963dcb8de45ca3a0a (patch) | |
| tree | 3fac58eff5e7f0150874e1205dfcc4dfe8a28455 /sqlparse/utils.py | |
| parent | 50de51a5d6abb2a2f8649091912090983dab843d (diff) | |
| parent | 42fb1d05b601444599f10d10c5d2dd0b431ccc15 (diff) | |
| download | sqlparse-8ad44059d4d9ab5a8a7489a963dcb8de45ca3a0a.tar.gz | |
Merge pull request #255 from vmuriart/console-script-examples-sqlOperation
Add Console-script, sql.Operation, fix examples
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: |
