ReplaceValues.py: make the file compilable with Python 3

see the mailing list thread "compilation of LyX 2.3 fails with Python 3.6.2" for details
This commit is contained in:
Uwe Stöhr 2017-10-16 23:29:57 +02:00
parent f1e1739d62
commit f075f8ad0a

View File

@ -13,6 +13,7 @@ from __future__ import print_function
import sys
import re
import codecs
Subst = {} # map of desired substitutions
prog = re.compile("")
@ -33,8 +34,8 @@ def SubstituteDataInLine(line):
def SubstituteDataInFile(InFile):
for line in open(InFile):
print(SubstituteDataInLine(line[:-1]))
for line in codecs.open(InFile, 'r', 'utf-8'):
print(SubstituteDataInLine(line[:-1]).encode("utf-8"))
##########################################