Ensure compatibility with newer sqlparse modules. Fixes #1725

This commit is contained in:
Murtuza Zabuawala
2016-09-26 13:49:54 +01:00
committed by Dave Page
parent e591c6b5c0
commit a0a6428e86
2 changed files with 6 additions and 1 deletions

View File

@@ -671,6 +671,11 @@ class SQLAutoComplete(object):
full_text, identifier)
def suggest_based_on_last_token(self, token, text_before_cursor, full_text, identifier):
# New version of sqlparse sends tuple, we need to make it
# compatible with our logic
if isinstance(token, tuple) and len(token) > 1:
token = token[1]
if isinstance(token, string_types):
token_v = token.lower()
elif isinstance(token, Comparison):