summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2007-06-30 22:06:39 +0200
committergbrandl <devnull@localhost>2007-06-30 22:06:39 +0200
commitdb3bdefe207add8cf1b26e626949d1e7dd6ef644 (patch)
treecce73807829efe6ec61bfcc87cfc09d9430eaf9a
parent04ec598059024c63c363b46b64929dabccf46ae7 (diff)
downloadpygments-db3bdefe207add8cf1b26e626949d1e7dd6ef644.tar.gz
[svn] Be even more cautious.
-rw-r--r--pygments/cmdline.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pygments/cmdline.py b/pygments/cmdline.py
index 8d7b56fe..2aba87ca 100644
--- a/pygments/cmdline.py
+++ b/pygments/cmdline.py
@@ -342,8 +342,8 @@ def main(args):
fmter.encoding = 'latin1'
else:
# use terminal encoding
- lexer.encoding = sys.stdin.encoding or 'ascii'
- fmter.encoding = sys.stdout.encoding or 'ascii'
+ lexer.encoding = getattr(sys.stdin, 'encoding', None) or 'ascii'
+ fmter.encoding = getattr(sys.stdout, 'encoding', None) or 'ascii'
# ... and do it!
try: