diff --git a/pythonforandroid/bootstraps/common/build/build.py b/pythonforandroid/bootstraps/common/build/build.py index 97fd48daf6..3aaf51d009 100644 --- a/pythonforandroid/bootstraps/common/build/build.py +++ b/pythonforandroid/bootstraps/common/build/build.py @@ -498,14 +498,16 @@ def make_package(args): with open('project.properties', 'r') as fileh: target = fileh.read().strip() android_api = target.split('-')[1] - try: - int(android_api) - except (ValueError, TypeError): + + if android_api.isdigit(): + android_api = int(android_api) + else: raise ValueError( "failed to extract the Android API level from " + "build.properties. expected int, got: '" + str(android_api) + "'" ) + with open('local.properties', 'r') as fileh: sdk_dir = fileh.read().strip() sdk_dir = sdk_dir[8:]