From: Oleg Broytman Date: Thu, 11 Aug 2016 07:17:56 +0000 (+0300) Subject: Simplify print_tokens() X-Git-Tag: 0.0.1~34 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=28b15069b60bba71d6b3b8a038353039aaf9b2d6;p=sqlconvert.git Simplify print_tokens() --- diff --git a/mysql2sql/print_tokens.py b/mysql2sql/print_tokens.py index 0f03d03..5d104c3 100644 --- a/mysql2sql/print_tokens.py +++ b/mysql2sql/print_tokens.py @@ -12,10 +12,10 @@ from sqlparse.sql import TokenList def print_tokens(token_list, outfile=sys.stdout, level=0): for token in token_list: - if not isinstance(token, TokenList): - outfile.write(token.normalized) if isinstance(token, TokenList): print_tokens(token, outfile, level+1) + else: + outfile.write(token.normalized) def get_tokens_str(token_list):