From e51fbdff1d111a39dd78bb5e6b1ab1d8f599e51b Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Sun, 30 Mar 2014 14:24:33 +0200 Subject: Add flake8 to tox configuration and code cleanup. --- sqlparse/engine/grouping.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sqlparse/engine') diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index d6f1360..e3b41c9 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -114,7 +114,7 @@ def group_as(tlist): def _right_valid(token): # Currently limited to DML/DDL. Maybe additional more non SQL reserved # keywords should appear here (see issue8). - return not token.ttype in (T.DML, T.DDL) + return token.ttype not in (T.DML, T.DDL) def _left_valid(token): if token.ttype is T.Keyword and token.value in ('NULL',): @@ -210,9 +210,10 @@ def group_identifier(tlist): if identifier_tokens and identifier_tokens[-1].ttype is T.Whitespace: identifier_tokens = identifier_tokens[:-1] if not (len(identifier_tokens) == 1 - and (isinstance(identifier_tokens[0], (sql.Function, sql.Parenthesis)) - or identifier_tokens[0].ttype in (T.Literal.Number.Integer, - T.Literal.Number.Float))): + and (isinstance(identifier_tokens[0], (sql.Function, + sql.Parenthesis)) + or identifier_tokens[0].ttype in ( + T.Literal.Number.Integer, T.Literal.Number.Float))): group = tlist.group_tokens(sql.Identifier, identifier_tokens) idx = tlist.token_index(group) + 1 else: -- cgit v1.2.1