Use ScopeGuard for _no_check_selection
[dcpomatic.git] / doc / manual / pptex.py
index 85653e5a545df6a2aa47795106a3aa4737b008d6..fade5943cbffd0d6fd791e305c8aacd76d086498 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Farcical script to remove newlines after
 # \begin{sidebar} in dblatex' .tex output;
@@ -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