Python 3 compatibility for pptext.py
authorCarl Hetherington <cth@carlh.net>
Sat, 24 Sep 2022 20:48:33 +0000 (22:48 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 24 Sep 2022 20:48:33 +0000 (22:48 +0200)
doc/manual/pptex.py

index 85653e5a545df6a2aa47795106a3aa4737b008d6..91425a0606c9a7af8ace7c8067df75fd7e969ee8 100755 (executable)
@@ -14,15 +14,15 @@ import tempfile
 import shutil
 
 f = open(sys.argv[1])
-t = tempfile.NamedTemporaryFile(delete = False)
+t = tempfile.NamedTemporaryFile(delete=False)
 remove_next = False
-while 1:
+while True:
     l = f.readline()
     if l == '':
         break
 
     if not remove_next:
-        print>>t,l,
+        t.write(l.encode('UTF-8'))
 
     remove_next = False