From: Oleg Broytman Date: Mon, 26 Sep 2016 21:50:29 +0000 (+0300) Subject: Fix a bug: assign buffer even if encoding is None X-Git-Tag: 0.0.7~4 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=9c98db83f4a907d85e5b29404bc50df0e4a2dc66;p=sqlconvert.git Fix a bug: assign buffer even if encoding is None --- diff --git a/sqlconvert/print_tokens.py b/sqlconvert/print_tokens.py index a0a4f8b..6aa6fb4 100644 --- a/sqlconvert/print_tokens.py +++ b/sqlconvert/print_tokens.py @@ -5,6 +5,8 @@ import sys def print_tokens(token_list, outfile=sys.stdout, encoding=None): if encoding: buffer = getattr(outfile, 'buffer', outfile) + else: + buffer = outfile for token in token_list.flatten(): normalized = token.normalized if encoding: