summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-08-12 18:18:03 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-08-12 18:18:03 (GMT)
commit019f3617f8e5c667c4db3182ead37f2c1fbb0268 (patch)
treef3d964eb8b7e6dbefb0a6b259f86f7da35a3de9f
parent23490202dee5654d40de359f11a376fa2b6436ce (diff)
downloadcpython-019f3617f8e5c667c4db3182ead37f2c1fbb0268.zip
cpython-019f3617f8e5c667c4db3182ead37f2c1fbb0268.tar.gz
cpython-019f3617f8e5c667c4db3182ead37f2c1fbb0268.tar.bz2
search through db.h in binary #6680
-rw-r--r--setup.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index f8bf421..f44550e 100644
--- a/setup.py
+++ b/setup.py
@@ -725,17 +725,17 @@ class PyBuildExt(build_ext):
f = os.path.join(d, "db.h")
if db_setup_debug: print("db: looking for db.h in", f)
if os.path.exists(f):
- f = open(f).read()
- m = re.search(r"#define\WDB_VERSION_MAJOR\W(\d+)", f)
+ f = open(f, "rb").read()
+ m = re.search(br"#define\WDB_VERSION_MAJOR\W(\d+)", f)
if m:
db_major = int(m.group(1))
- m = re.search(r"#define\WDB_VERSION_MINOR\W(\d+)", f)
+ m = re.search(br"#define\WDB_VERSION_MINOR\W(\d+)", f)
db_minor = int(m.group(1))
db_ver = (db_major, db_minor)
# Avoid 4.6 prior to 4.6.21 due to a BerkeleyDB bug
if db_ver == (4, 6):
- m = re.search(r"#define\WDB_VERSION_PATCH\W(\d+)", f)
+ m = re.search(br"#define\WDB_VERSION_PATCH\W(\d+)", f)
db_patch = int(m.group(1))
if db_patch < 21:
print("db.h:", db_ver, "patch", db_patch,