File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
pythonforandroid/bootstraps/sdl2/build Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -491,6 +491,9 @@ def parse_args(args=None):
491
491
'NAME:PATH_TO_PY[:foreground]' )
492
492
ap .add_argument ('--add-source' , dest = 'extra_source_dirs' , action = 'append' ,
493
493
help = 'Include additional source dirs in Java build' )
494
+ ap .add_argument ('--try-system-python-compile' , dest = 'try_system_python_compile' ,
495
+ action = 'store_true' ,
496
+ help = 'Use the system python during compileall if possible.' )
494
497
ap .add_argument ('--no-compile-pyo' , dest = 'no_compile_pyo' , action = 'store_true' ,
495
498
help = 'Do not optimise .py files to .pyo.' )
496
499
ap .add_argument ('--sign' , action = 'store_true' ,
@@ -524,6 +527,17 @@ def parse_args(args=None):
524
527
if args .services is None :
525
528
args .services = []
526
529
530
+ if args .try_system_python_compile :
531
+ # Hardcoding python2.7 is okay for now, as python3 skips the
532
+ # compilation anyway
533
+ python_executable = 'python2.7'
534
+ try :
535
+ subprocess .call ([python_executable , '--version' ])
536
+ except (OSError , subprocess .CalledProcessError ):
537
+ pass
538
+ else :
539
+ PYTHON = python_executable
540
+
527
541
if args .no_compile_pyo :
528
542
PYTHON = None
529
543
BLACKLIST_PATTERNS .remove ('*.py' )
You can’t perform that action at this time.
0 commit comments