Skip to content

Commit 6ba1c4e

Browse files
author
Geert Vanderkelen
committed
BUG20114310: Add support static linking C Extension
Extra fix for Python 3, using bytes instead of str when checking the version of my_config.h.
1 parent 769402e commit 6ba1c4e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/cpy_distutils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,11 @@ def _finalize_connector_c(self, connc_loc):
256256
else:
257257
with open(myconfigh, 'rb') as fp:
258258
for line in fp.readlines():
259-
if '#define VERSION' in line:
259+
if b'#define VERSION' in line:
260260
version = tuple([
261261
int(v) for v in
262-
line.split()[2].replace('"', '').split('.')
262+
line.split()[2].replace(
263+
b'"', b'').split(b'.')
263264
])
264265
if version < min_version:
265266
log.error(err_version);

0 commit comments

Comments
 (0)