[Python-checkins] r74357 - python/branches/py3k/setup.py
benjamin.peterson
python-checkins at python.org
Wed Aug 12 20:18:05 CEST 2009
Author: benjamin.peterson
Date: Wed Aug 12 20:18:03 2009
New Revision: 74357
Log:
search through db.h in binary #6680
Modified:
python/branches/py3k/setup.py
Modified: python/branches/py3k/setup.py
==============================================================================
--- python/branches/py3k/setup.py (original)
+++ python/branches/py3k/setup.py Wed Aug 12 20:18:03 2009
@@ -725,17 +725,17 @@
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,
More information about the Python-checkins
mailing list