diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2018-11-22 00:14:05 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2018-11-22 00:14:05 +0000 |
commit | fe6f37d68b9d3c5ef629e7b6f8a4c00b2925b33b (patch) | |
tree | 86eca3e16199c286ddf38146e2a9b8a84c782108 | |
parent | 3c83e1eb479007ac07b568aa359e835f6e5aa5b3 (diff) | |
download | apr-fe6f37d68b9d3c5ef629e7b6f8a4c00b2925b33b.tar.gz |
Fix Python3 compatibility.
* build/gen-build.py (extract_deps): Do not assume that source files are only ASCII.
This fixes a build failure on macOS High Sierra.
(Note 1.6 is still in maintainence, 1.7 not yet released.)
Backports: r1846806
Submitted by: brane
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1847147 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) |