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
@@ -275,7 +275,7 @@ def parse_partial_identifier(word):
n_tok = len(p.tokens)
if n_tok == 1 and isinstance(p.tokens[0], Identifier):
return p.tokens[0]
elif p.token_next_match(0, Error, '"'):
elif hasattr(p, 'token_next_match') and p.token_next_match(0, Error, '"'):
# An unmatched double quote, e.g. '"foo', 'foo."', or 'foo."bar'
# Close the double quote, then reparse
return parse_partial_identifier(word + '"')