Merge pull request #41860 from akien-mga/3.2-scons-fixup-py2

SCons: Fix regression in Python 2 support
This commit is contained in:
Rémi Verschelde 2020-09-07 21:12:54 +02:00 committed by GitHub
commit a30d8e231d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import re
import glob import glob
import subprocess import subprocess
from collections import OrderedDict from collections import OrderedDict
from compat import iteritems, isbasestring, decode_utf8, qualname from compat import iteritems, isbasestring, open_utf8, decode_utf8, qualname
def add_source_files(self, sources, files, warn_duplicates=True): def add_source_files(self, sources, files, warn_duplicates=True):
@ -86,7 +86,7 @@ def update_version(module_version_string=""):
gitfolder = module_folder[8:] gitfolder = module_folder[8:]
if os.path.isfile(os.path.join(gitfolder, "HEAD")): if os.path.isfile(os.path.join(gitfolder, "HEAD")):
head = open(os.path.join(gitfolder, "HEAD"), "r", encoding="utf8").readline().strip() head = open_utf8(os.path.join(gitfolder, "HEAD"), "r").readline().strip()
if head.startswith("ref: "): if head.startswith("ref: "):
head = os.path.join(gitfolder, head[5:]) head = os.path.join(gitfolder, head[5:])
if os.path.isfile(head): if os.path.isfile(head):