]> git.phdru.name Git - sqlconvert.git/commitdiff
Fix: test if token is an instance of Comment
authorOleg Broytman <phd@phdru.name>
Sun, 19 Mar 2017 16:16:11 +0000 (19:16 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 19 Mar 2017 16:16:11 +0000 (19:16 +0300)
sqlconvert/process_tokens.py

index e55513e19afb2de13591a113c4f3000721c4322d..cb14467ccf958b478d888714ebaa6240e10fede2 100644 (file)
@@ -1,4 +1,5 @@
 
+from sqlparse.sql import Comment
 from sqlobject.converters import sqlrepr
 from sqlparse import parse
 from sqlparse.compat import PY3
@@ -14,8 +15,9 @@ def find_error(token_list):
 
 
 def is_comment_or_space(token):
-    return token.ttype in (T.Comment.Single, T.Comment.Multiline,
-                           T.Newline, T.Whitespace)
+    return isinstance(token, Comment) or \
+        token.ttype in (T.Comment, T.Comment.Single, T.Comment.Multiline,
+                        T.Newline, T.Whitespace)
 
 
 def is_newline_statement(statement):