File tree Expand file tree Collapse file tree
pythonforandroid/bootstraps/common/build Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ def get_hostpython():
3939 return get_dist_info_for ('hostpython' )
4040
4141
42+ def get_python_version ():
43+ return get_dist_info_for ('python_version' )
44+
45+
4246def get_bootstrap_name ():
4347 return get_dist_info_for ('bootstrap' )
4448
@@ -53,6 +57,7 @@ def get_bootstrap_name():
5357curdir = dirname (__file__ )
5458
5559PYTHON = get_hostpython ()
60+ PYTHON_VERSION = get_python_version ()
5661if PYTHON is not None and not exists (PYTHON ):
5762 PYTHON = None
5863
@@ -63,17 +68,18 @@ def get_bootstrap_name():
6368 '^*.bzr/*' ,
6469 '^*.svn/*' ,
6570
66- # pyc/py
67- '*.pyc' ,
68- # '*.py',
69-
7071 # temp files
7172 '~' ,
7273 '*.bak' ,
7374 '*.swp' ,
7475]
76+ # pyc/py
7577if PYTHON is not None :
7678 BLACKLIST_PATTERNS .append ('*.py' )
79+ if PYTHON_VERSION and int (PYTHON_VERSION [0 ]) == 2 :
80+ # we only blacklist `.pyc` for python2 because in python3 the compiled
81+ # extension is `.pyc` (.pyo files not exists for python >= 3.6)
82+ BLACKLIST_PATTERNS .append ('*.pyc' )
7783
7884WHITELIST_PATTERNS = []
7985if get_bootstrap_name () in ('sdl2' , 'webview' , 'service_only' ):
You can’t perform that action at this time.
0 commit comments