From 5d77addc60bccd5ea72781d8fd08ba6502e3ae47 Mon Sep 17 00:00:00 2001 From: Victor Uriarte Date: Sun, 29 May 2016 11:11:20 -0700 Subject: Fix unicode comparison warning --- sqlparse/engine/grouping.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sqlparse/engine/grouping.py') diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index f7953e7..c7c0d42 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -223,9 +223,9 @@ def group_functions(tlist): has_create = False has_table = False for tmp_token in tlist.tokens: - if tmp_token.value == u'CREATE': + if tmp_token.value == 'CREATE': has_create = True - if tmp_token.value == u'TABLE': + if tmp_token.value == 'TABLE': has_table = True if has_create and has_table: return -- cgit v1.2.1 From af37d16bae4f1c96d3936771d74424d1d54ddf74 Mon Sep 17 00:00:00 2001 From: Victor Uriarte Date: Sun, 29 May 2016 11:26:43 -0700 Subject: Fix flake8 styling --- sqlparse/engine/grouping.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sqlparse/engine/grouping.py') diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index c7c0d42..7a93b5e 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -27,15 +27,16 @@ def _group_left_right(tlist, m, cls, if valid_left(left) and valid_right(right): if semicolon: + # only overwrite if a semicolon present. sright = tlist.token_next_by(m=M_SEMICOLON, idx=right) - right = sright or right # only overwrite if a semicolon present. + right = sright or right tokens = tlist.tokens_between(left, right) token = tlist.group_tokens(cls, tokens, extend=True) token = tlist.token_next_by(m=m, idx=token) def _group_matching(tlist, cls): - """Groups Tokens that have beginning and end. ie. parenthesis, brackets..""" + """Groups Tokens that have beginning and end.""" idx = 1 if imt(tlist, i=cls) else 0 token = tlist.token_next_by(m=cls.M_OPEN, idx=idx) -- cgit v1.2.1