From 217dbdc9e7f65f51524653801663bdd01fe71ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 7 Sep 2020 20:28:58 +0200 Subject: [PATCH] SCons: Fix regression in Python 2 support Introduced in 7e1312055bcb6a65f934728e29291ae00a1d1a19 by not using the compat method. Fixes #41858. --- methods.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/methods.py b/methods.py index ed025a2e89f..c393e7ca5b4 100644 --- a/methods.py +++ b/methods.py @@ -3,7 +3,7 @@ import re import glob import subprocess 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): @@ -86,7 +86,7 @@ def update_version(module_version_string=""): gitfolder = module_folder[8:] 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: "): head = os.path.join(gitfolder, head[5:]) if os.path.isfile(head):