8000 Blacklist files depending on python version · onlyskin/python-for-android@42f89d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 42f89d2

Browse files
committed
Blacklist files depending on python version
Because the compilation to .pyo extension only exists for python2. Since python >= 3.5 the extension for the compiled files is .pyc.
1 parent 327dabd commit 42f89d2

File tree

1 file changed

+10
-4
lines changed
  • pythonforandroid/bootstraps/common/build

1 file changed

+10
-4
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff 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+
4246
def get_bootstrap_name():
4347
return get_dist_info_for('bootstrap')
4448

@@ -53,6 +57,7 @@ def get_bootstrap_name():
5357
curdir = dirname(__file__)
5458

5559
PYTHON = get_hostpython()
60+
PYTHON_VERSION = get_python_version()
5661
if 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
7577
if 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

7884
WHITELIST_PATTERNS = []
7985
if get_bootstrap_name() in ('sdl2', 'webview', 'service_only'):

0 commit comments

Comments
 (0)
0