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/?p=sqlconvert.git;a=commitdiff_plain;h=9c98db83f4a907d85e5b29404bc50df0e4a2dc66 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: