diff scripts/getan-eval.py @ 467:59d9c5840273

Porting Python 2 to Python 3.
author Magnus Schieder <mschieder@intevation.de>
date Thu, 03 May 2018 15:38:42 +0200
parents 24ccca2442b1
children 999a438474f2
line wrap: on
line diff
--- a/scripts/getan-eval.py	Wed May 02 13:46:50 2018 +0200
+++ b/scripts/getan-eval.py	Thu May 03 15:38:42 2018 +0200
@@ -53,16 +53,15 @@
     if not args.encoding:
         encoding = locale.getdefaultlocale()[1] or "utf-8"
 
-    Writer = codecs.getwriter(encoding)
-    sys.stdout = Writer(sys.stdout)
+    sys.stdout = codecs.getwriter(encoding)(sys.stdout.detach())
 
     user = None
     if args.user:
         user = args.user.decode(encoding)
 
-    print render(database=args.database, user=user,
+    print(render(database=args.database, user=user,
                  template=template_name, year=year, week=week,
-                 project=args.project, empty_projects=args.empty)
+                 project=args.project, empty_projects=args.empty))
 
 
 if __name__ == '__main__':
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)