Skip to content

Commit 6751593

Browse files
committed
Fixed API level calculation for non-ints
1 parent cb0b399 commit 6751593

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pythonforandroid/toolchain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,8 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
588588
android = sh.Command(join(sdk_dir, 'tools', 'android'))
589589
targets = android('list').stdout.split('\n')
590590
apis = [s for s in targets if re.match(r'^ *API level: ', s)]
591-
apis = [int(re.findall(r'[0-9]+', s)[0]) for s in apis]
591+
apis = [re.findall(r'[0-9]+', s) for s in apis]
592+
apis = [int(s[0]) for s in apis if s]
592593
info('Available Android APIs are ({})'.format(', '.join(map(str, apis))))
593594
if android_api in apis:
594595
info('Requested API target {} is available, continuing.'.format(android_api))

0 commit comments

Comments
 (0)