From 28b15069b60bba71d6b3b8a038353039aaf9b2d6 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 11 Aug 2016 10:17:56 +0300 Subject: [PATCH] Simplify print_tokens() --- mysql2sql/print_tokens.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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): -- 2.39.5