File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
pythonforandroid/bootstraps/common/build Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -477,17 +477,15 @@ def make_package(args):
477477 foreground = 'foreground' in options
478478 sticky = 'sticky' in options
479479 foreground_type_option = next ((s for s in options if s .startswith ('foregroundServiceType' )), None )
480+ foreground_type = None
480481 if foreground_type_option :
481- try :
482- foreground_type = foreground_type_option .split ('=' )[1 ]
483- if not foreground_type :
484- raise ValueError ('Missing value for `foregroundServiceType` option. '
485- 'Expected format: foregroundServiceType=location' )
486- except IndexError :
487- raise ValueError ('Missing value for `foregroundServiceType` option. '
488- 'Expected format: foregroundServiceType=location' )
489- else :
490- foreground_type = None
482+ parts = foreground_type_option .split ('=' , 1 )
483+ if len (parts ) != 2 or not parts [1 ]:
484+ raise ValueError (
485+ 'Missing value for `foregroundServiceType` option. '
486+ 'Expected format: foregroundServiceType=location'
487+ )
488+ foreground_type = parts [1 ]
491489
492490 service_data .append ((name , foreground_type ))
493491 service_target_path = \
You can’t perform that action at this time.
0 commit comments