You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2018/11/22 00:14:05 UTC

svn commit: r1847147 - /apr/apr/branches/1.6.x/build/gen-build.py

Author: wrowe
Date: Thu Nov 22 00:14:05 2018
New Revision: 1847147

URL: http://svn.apache.org/viewvc?rev=1847147&view=rev
Log:
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

Modified:
    apr/apr/branches/1.6.x/build/gen-build.py

Modified: apr/apr/branches/1.6.x/build/gen-build.py
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/build/gen-build.py?rev=1847147&r1=1847146&r2=1847147&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/build/gen-build.py (original)
+++ apr/apr/branches/1.6.x/build/gen-build.py Thu Nov 22 00:14:05 2018
@@ -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,
 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)