diff options
author | Stefan Ritter <xeno@thehappy.de> | 2011-05-18 23:05:51 +0200 |
---|---|---|
committer | Stefan Ritter <xeno@thehappy.de> | 2011-05-18 23:05:51 +0200 |
commit | b06dc41a2c10fb447c089357493b8e86958174cb (patch) | |
tree | 58ad953f7687d044b1f4ea5831aeace9285c99b9 /blogthon.cgi | |
parent | ab959ad834ba4c70f7f6e7355cf158ce2b31a8ee (diff) |
Compatibility fix
Diffstat (limited to 'blogthon.cgi')
-rwxr-xr-x | blogthon.cgi | 7 |
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: |