From 3ca451ce7cd26a5444c2dc3897f7559db062de59 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 19 Mar 2017 19:16:11 +0300 Subject: [PATCH] Fix: test if token is an instance of Comment --- sqlconvert/process_tokens.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sqlconvert/process_tokens.py b/sqlconvert/process_tokens.py index e55513e..cb14467 100644 --- a/sqlconvert/process_tokens.py +++ b/sqlconvert/process_tokens.py @@ -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): -- 2.39.5