svn commit: r1935502 - in apr/apr/branches/1.8.x: . build
[email protected] Fri, 19 Jun 2026 07:55:13 -0000
| Newsgroups | gmane.comp.apache.apr.cvs |
|---|---|
| Message-ID | <178185571346.3228696.6959288148445678755@svn03-he-fi> |
Author: brane
Date: Fri Jun 19 07:55:13 2026
New Revision: 1935502
Log:
Merged r1935500 from trunk:
* build/gen-build.py: codecs.open() is deprecated since Python 3.14.
Use open() with Python 3 and maintain Pyton 2.7 compatibility.
Modified:
apr/apr/branches/1.8.x/ (props changed)
apr/apr/branches/1.8.x/build/ (props changed)
apr/apr/branches/1.8.x/build/gen-build.py
Modified: apr/apr/branches/1.8.x/build/gen-build.py
==============================================================================
--- apr/apr/branches/1.8.x/build/gen-build.py Fri Jun 19 07:55:00 2026 (r1935501)
+++ apr/apr/branches/1.8.x/build/gen-build.py Fri Jun 19 07:55:13 2026 (r1935502)
@@ -12,11 +12,14 @@
import os
try:
import configparser
+ def open_with_encoding(path, mode, encoding):
+ return open(path, mode, encoding=encoding)
except ImportError:
+ # Python 2.7 compatibility
+ import codecs
import ConfigParser as configparser
-import codecs
-import getopt
-import string
+ def open_with_encoding(path, mode, encoding):
+ return codecs.open(path, mode, encoding)
import glob
import re
@@ -196,7 +199,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 codecs.open(fname, 'r', 'utf-8').readlines():
+ for line in open_with_encoding(fname, 'r', 'utf-8').readlines():
if line[:8] != '#include':
continue
inc = _re_include.match(line).group(1)