Skip to content

Commit 62e0def

Browse files
authored
android_api to integer (#2765)
* android_api to integer * changes to android_api * changes to android_api
1 parent 8bed427 commit 62e0def

File tree

1 file changed

+5
-3
lines changed
  • pythonforandroid/bootstraps/common/build

1 file changed

+5
-3
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,16 @@ def make_package(args):
498498
with open('project.properties', 'r') as fileh:
499499
target = fileh.read().strip()
500500
android_api = target.split('-')[1]
501-
try:
502-
int(android_api)
503-
except (ValueError, TypeError):
501+
502+
if android_api.isdigit():
503+
android_api = int(android_api)
504+
else:
504505
raise ValueError(
505506
"failed to extract the Android API level from " +
506507
"build.properties. expected int, got: '" +
507508
str(android_api) + "'"
508509
)
510+
509511
with open('local.properties', 'r') as fileh:
510512
sdk_dir = fileh.read().strip()
511513
sdk_dir = sdk_dir[8:]

0 commit comments

Comments
 (0)