@@ -155,10 +155,22 @@ def __init__(self, *args, **kwargs):
155
155
@property
156
156
def _libpython (self ):
157
157
'''return the python's library name (with extension)'''
158
- py_version = self .major_minor_version_string
159
- if self .major_minor_version_string [0 ] == '3' :
160
- py_version += 'm'
161
- return 'libpython{version}.so' .format (version = py_version )
158
+ return 'libpython{link_version}.so' .format (
159
+ link_version = self .link_version
160
+ )
161
+
162
+ @property
163
+ def link_version (self ):
164
+ '''return the python's library link version e.g. 3.7m, 3.8'''
165
+ major , minor = self .major_minor_version_string .split ('.' )
166
+ flags = ''
167
+ if major == '3' and int (minor ) < 8 :
168
+ flags += 'm'
169
+ return '{major}.{minor}{flags}' .format (
170
+ major = major ,
171
+ minor = minor ,
172
+ flags = flags
173
+ )
162
174
163
175
def include_root (self , arch_name ):
164
176
return join (self .get_build_dir (arch_name ), 'Include' )
@@ -393,9 +405,7 @@ def create_python_bundle(self, dirn, arch):
393
405
# copy the python .so files into place
394
406
python_build_dir = join (self .get_build_dir (arch .arch ),
395
407
'android-build' )
396
- python_lib_name = 'libpython' + self .major_minor_version_string
397
- if self .major_minor_version_string [0 ] == '3' :
398
- python_lib_name += 'm'
408
+ python_lib_name = 'libpython' + self .link_version
399
409
shprint (
400
410
sh .cp ,
401
411
join (python_build_dir , python_lib_name + '.so' ),
0 commit comments