svn commit: r1935500 - apr/apr/trunk/build
[email protected] Fri, 19 Jun 2026 07:41:22 -0000
| Newsgroups | gmane.comp.apache.apr.cvs |
|---|---|
| Message-ID | <178185488201.3223843.13628041944517521213@svn03-he-fi> |
Author: brane
Date: Fri Jun 19 07:41:21 2026
New Revision: 1935500
Log:
* 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/trunk/build/gen-build.py
Modified: apr/apr/trunk/build/gen-build.py
==============================================================================
--- apr/apr/trunk/build/gen-build.py Fri Jun 19 07:15:14 2026 (r1935499)
+++ apr/apr/trunk/build/gen-build.py Fri Jun 19 07:41:21 2026 (r1935500)
@@ -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
@@ -190,7 +193,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)