diff options
| author | Jesús Leganés Combarro "Piranna" <piranna@gmail.com> | 2012-03-24 18:00:57 +0100 |
|---|---|---|
| committer | Jesús Leganés Combarro "Piranna" <piranna@gmail.com> | 2012-03-24 18:00:57 +0100 |
| commit | 38b1106fed5ea75165d81c87855a1f7c1e0cd71f (patch) | |
| tree | 4ba2bd613431205dfd2b28dc3fd5b7321fd393e7 /sqlparse | |
| parent | 0691a8c8a38485745098b21cf46f8dac655a0b98 (diff) | |
| download | sqlparse-38b1106fed5ea75165d81c87855a1f7c1e0cd71f.tar.gz | |
Fixed bug on StripWhitespace
Diffstat (limited to 'sqlparse')
| -rw-r--r-- | sqlparse/filters.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sqlparse/filters.py b/sqlparse/filters.py index a639f7a..83c466b 100644 --- a/sqlparse/filters.py +++ b/sqlparse/filters.py @@ -80,24 +80,17 @@ def StripWhitespace(stream): last_type = None for token_type, value in stream: - print repr(token_type), repr(value) # We got a previous token if last_type: - print '\t 1', repr(token_type), repr(value) - if token_type in Whitespace: - if last_type in Whitespace: + if last_type in (Whitespace, Whitespace.Newline, Punctuation): continue value = ' ' # Ignore first empty spaces and dot-commas - elif token_type in Whitespace + Punctuation: + elif token_type in (Whitespace, Whitespace.Newline, Punctuation): continue - # There's no previous token - else: - print '\t 2', repr(token_type), repr(value) - yield token_type, value last_type = token_type |
