Skip to content

Commit 1d525a6

Browse files
committed
Changes to compile .pyo with sdl2
1 parent df84ca5 commit 1d525a6

File tree

1 file changed

+8
-3
lines changed
  • pythonforandroid/bootstraps/sdl2/build

1 file changed

+8
-3
lines changed

pythonforandroid/bootstraps/sdl2/build/build.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828

2929
# Try to find a host version of Python that matches our ARM version.
3030
PYTHON = join(curdir, 'python-install', 'bin', 'python.host')
31+
if not exists(PYTHON):
32+
print('Could not find hostpython, will not compile to .pyo (this is normal with python3)')
33+
PYTHON = None
34+
PYTHON = None
3135

3236
BLACKLIST_PATTERNS = [
3337
# code versionning
@@ -38,13 +42,14 @@
3842

3943
# pyc/py
4044
'*.pyc',
41-
# '*.py', # AND: Need to fix this to add it back
4245

4346
# temp files
4447
'~',
4548
'*.bak',
4649
'*.swp',
4750
]
51+
if PYTHON is not None:
52+
BLACKLIST_PATTERNS.append('*.py')
4853

4954
WHITELIST_PATTERNS = []
5055

@@ -202,9 +207,9 @@ def compile_dir(dfn):
202207
'''
203208
Compile *.py in directory `dfn` to *.pyo
204209
'''
205-
206-
return # AND: Currently leaving out the compile to pyo step because it's somehow broken
207210
# -OO = strip docstrings
211+
if PYTHON is None:
212+
return
208213
subprocess.call([PYTHON, '-OO', '-m', 'compileall', '-f', dfn])
209214

210215

0 commit comments

Comments
 (0)