@@ -590,16 +590,16 @@ def parse_args(args=None):
590
590
ap .add_argument ('--launcher' , dest = 'launcher' , action = 'store_true' ,
591
591
help = ('Provide this argument to build a multi-app '
592
592
'launcher, rather than a single app.' ))
593
- ap .add_argument ('--permission' , dest = 'permissions' , action = 'append' ,
593
+ ap .add_argument ('--permission' , dest = 'permissions' , action = 'append' , default = [],
594
594
help = 'The permissions to give this app.' , nargs = '+' )
595
- ap .add_argument ('--meta-data' , dest = 'meta_data' , action = 'append' ,
595
+ ap .add_argument ('--meta-data' , dest = 'meta_data' , action = 'append' , default = [],
596
596
help = 'Custom key=value to add in application metadata' )
597
- ap .add_argument ('--uses-library' , dest = 'android_used_libs' , action = 'append' ,
597
+ ap .add_argument ('--uses-library' , dest = 'android_used_libs' , action = 'append' , default = [],
598
598
help = 'Used shared libraries included using <uses-library> tag in AndroidManifest.xml' )
599
599
ap .add_argument ('--icon' , dest = 'icon' ,
600
600
help = ('A png file to use as the icon for '
601
601
'the application.' ))
602
- ap .add_argument ('--service' , dest = 'services' , action = 'append' ,
602
+ ap .add_argument ('--service' , dest = 'services' , action = 'append' , default = [],
603
603
help = 'Declare a new service entrypoint: '
604
604
'NAME:PATH_TO_PY[:foreground]' )
605
605
if get_bootstrap_name () != "service_only" :
@@ -742,21 +742,9 @@ def _read_configuration():
742
742
'deprecated and does nothing.' )
743
743
args .sdk_version = - 1 # ensure it is not used
744
744
745
- if args .permissions is None :
746
- args .permissions = []
747
- elif args .permissions :
748
- if isinstance (args .permissions [0 ], list ):
745
+ if args .permissions and isinstance (args .permissions [0 ], list ):
749
746
args .permissions = [p for perm in args .permissions for p in perm ]
750
747
751
- if args .meta_data is None :
752
- args .meta_data = []
753
-
754
- if args .android_used_libs is None :
755
- args .android_used_libs = []
756
-
757
- if args .services is None :
758
- args .services = []
759
-
760
748
if args .try_system_python_compile :
761
749
# Hardcoding python2.7 is okay for now, as python3 skips the
762
750
# compilation anyway
0 commit comments