diff options
Diffstat (limited to 'sqlparse')
| -rw-r--r-- | sqlparse/filters.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sqlparse/filters.py b/sqlparse/filters.py index 91258ff..f1163ca 100644 --- a/sqlparse/filters.py +++ b/sqlparse/filters.py @@ -4,6 +4,7 @@ import re from sqlparse.engine import grouping from sqlparse import tokens as T +from sqlparse import sql class Filter(object): @@ -171,8 +172,10 @@ class ReindentFilter(Filter): if prev and prev.is_whitespace(): tlist.tokens.pop(tlist.token_index(prev)) offset += 1 - if prev and (str(prev).endswith('\n') - or str(prev).endswith('\r')): + if (prev + and isinstance(prev, sql.Comment) + and (str(prev).endswith('\n') + or str(prev).endswith('\r'))): nl = tlist.token_next(token) else: nl = self.nl() |
