summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorBranko Čibej <brane@apache.org>2018-11-17 15:03:34 +0000
committerBranko Čibej <brane@apache.org>2018-11-17 15:03:34 +0000
commitfcfef625048b42edf03d0a895a207aecd14af29b (patch)
tree8b2a8fcbdb01811b8638098309c43867b742e335 /build
parent3b8b306b702f0c1ca18f1167728ab176c1e01676 (diff)
downloadapr-fcfef625048b42edf03d0a895a207aecd14af29b.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. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1846806 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build')
-rwxr-xr-xbuild/gen-build.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/build/gen-build.py b/build/gen-build.py
index 4874f0eb4..e1e7c93de 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
@@ -212,7 +213,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)