Skip to content

Commit 71fb556

Browse files
djsfcomandialbrecht
authored andcommitted
fix "WITH name" case (andialbrecht#418)
* fix "WITH name" case * fix "WITH name" case (flake8 fix)
1 parent 6dd17fa commit 71fb556

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sqlparse/sql.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ def get_type(self):
418418
if isinstance(token, (Identifier, IdentifierList)):
419419
_, dml_keyword = self.token_next(tidx, skip_ws=True)
420420

421-
if dml_keyword.ttype == T.Keyword.DML:
421+
if dml_keyword is not None \
422+
and dml_keyword.ttype == T.Keyword.DML:
422423
return dml_keyword.normalized
423424

424425
# Hmm, probably invalid syntax, so return unknown.

0 commit comments

Comments
 (0)