aboutsummaryrefslogtreecommitdiffstats
path: root/blogthon.cgi
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2011-05-18 23:05:51 +0200
committerStefan Ritter <xeno@thehappy.de>2011-05-18 23:05:51 +0200
commitb06dc41a2c10fb447c089357493b8e86958174cb (patch)
tree58ad953f7687d044b1f4ea5831aeace9285c99b9 /blogthon.cgi
parentab959ad834ba4c70f7f6e7355cf158ce2b31a8ee (diff)
Compatibility fix
Diffstat (limited to 'blogthon.cgi')
-rwxr-xr-xblogthon.cgi7
1 files changed, 5 insertions, 2 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index c49df11..963f120 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -20,8 +20,11 @@ import locale
import re
import codecs
-# print() will output ascii, but we want utf-8
-sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer)
+# print() will output ascii, but we want utf-8 (python3)
+try:
+ sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer)
+except:
+ None
# Backward compatibilty to python2
try: