diff options
author | brane <brane@13f79535-47bb-0310-9956-ffa450edef68> | 2018-11-17 15:28:30 +0000 |
---|---|---|
committer | brane <brane@13f79535-47bb-0310-9956-ffa450edef68> | 2018-11-17 15:28:30 +0000 |
commit | ba73a7e05cbce97314a38fbc4c6e91588196a188 (patch) | |
tree | 566b0ca52f1aeb4632059d2009bd5c4685f4508c | |
parent | 327e960d351e885916ff837b460c512ceec9a591 (diff) | |
download | libapr-ba73a7e05cbce97314a38fbc4c6e91588196a188.tar.gz |
Fix Python3 compatibility.
* build/gen-build.py (extract_deps): Do not assume that source files are only ASCII.
This fixes an APR-Util build failure on macOS High Sierra.
Backports: r1846806
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1846807 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | build/gen-build.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/build/gen-build.py b/build/gen-build.py index 70d88ba9a..53ca595f5 100755 --- a/build/gen-build.py +++ b/build/gen-build.py @@ -14,6 +14,7 @@ try: import configparser except ImportError: import ConfigParser as configparser +import codecs import getopt import string import glob @@ -195,7 +196,7 @@ def write_objects(f, legal_deps, h_deps, files): def extract_deps(fname, legal_deps): "Extract the headers this file includes." deps = { } - for line in open(fname).readlines(): + for line in codecs.open(fname, 'r', 'utf-8').readlines(): if line[:8] != '#include': continue inc = _re_include.match(line).group(1) |