summaryrefslogtreecommitdiff
path: root/pygments/cmdline.py
diff options
context:
space:
mode:
authorIgor Kalnitsky <igor@kalnitsky.org>2012-02-07 21:29:58 +0200
committerIgor Kalnitsky <igor@kalnitsky.org>2012-02-07 21:29:58 +0200
commit3d1b3982a4b4fb5dc8ad5eba70b2416fb980b8ec (patch)
treef086edf649eceda1602c73e3559b786585287407 /pygments/cmdline.py
parent62213ae784abde261ec76d59d3bbfc2f0967dc28 (diff)
parentb42b337d32c87768594934d01e0f40b4c83a435f (diff)
downloadpygments-3d1b3982a4b4fb5dc8ad5eba70b2416fb980b8ec.tar.gz
Merge with birkenfeld/pygments-main
Diffstat (limited to 'pygments/cmdline.py')
-rw-r--r--pygments/cmdline.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pygments/cmdline.py b/pygments/cmdline.py
index 7db761ca..e5b9b9b2 100644
--- a/pygments/cmdline.py
+++ b/pygments/cmdline.py
@@ -5,7 +5,7 @@
Command line interface.
- :copyright: Copyright 2006-2011 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
@@ -408,6 +408,9 @@ def main(args=sys.argv):
None) or 'ascii'
fmter.encoding = getattr(sys.stdout, 'encoding',
None) or 'ascii'
+ elif not outfn and sys.version_info > (3,):
+ # output to terminal with encoding -> use .buffer
+ outfile = sys.stdout.buffer
# ... and do it!
try: