]> git.phdru.name Git - sqlconvert.git/commitdiff
Fix a bug: assign buffer even if encoding is None
authorOleg Broytman <phd@phdru.name>
Mon, 26 Sep 2016 21:50:29 +0000 (00:50 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 26 Sep 2016 21:50:29 +0000 (00:50 +0300)
sqlconvert/print_tokens.py

index a0a4f8b05bcbc651b232b5cc636c952c8ab760fc..6aa6fb4dbf81e229c46cc503f94ae78bcae170b3 100644 (file)
@@ -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: