Skip to content

Commit e01cd7e

Browse files
committed
sdl2: prevent crash when using compile-all (same as pygame bootstrap)
1 parent bb5f009 commit e01cd7e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pythonforandroid/bootstraps/sdl2/__init__.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@ def run_distribute(self):
3535
shprint(sh.mkdir, 'crystax_python/crystax_python')
3636
if not exists('assets'):
3737
shprint(sh.mkdir, 'assets')
38-
38+
3939
hostpython = sh.Command(self.ctx.hostpython)
4040
if not self.ctx.python_recipe.from_crystax:
41-
shprint(hostpython, '-OO', '-m', 'compileall',
42-
self.ctx.get_python_install_dir(),
43-
_tail=10, _filterout="^Listing", _critical=True)
41+
try:
42+
shprint(hostpython, '-OO', '-m', 'compileall',
43+
self.ctx.get_python_install_dir(),
44+
_tail=10, _filterout="^Listing")
45+
except sh.ErrorReturnCode:
46+
pass
4447
if not exists('python-install'):
4548
shprint(sh.cp, '-a', self.ctx.get_python_install_dir(), './python-install')
4649

@@ -54,7 +57,7 @@ def run_distribute(self):
5457
info('private/lib does not exist, making')
5558
shprint(sh.cp, '-a', join('python-install', 'lib'), 'private')
5659
shprint(sh.mkdir, '-p', join('private', 'include', 'python2.7'))
57-
60+
5861
# AND: Copylibs stuff should go here
5962
if exists(join('libs', arch.arch, 'libpymodules.so')):
6063
shprint(sh.mv, join('libs', arch.arch, 'libpymodules.so'), 'private/')
@@ -92,7 +95,7 @@ def run_distribute(self):
9295
py_recipe = self.ctx.python_recipe
9396
python_dir = join(ndk_dir, 'sources', 'python', py_recipe.version,
9497
'libs', arch.arch)
95-
98+
9699
shprint(sh.cp, '-r', join(python_dir, 'stdlib.zip'), 'crystax_python/crystax_python')
97100
shprint(sh.cp, '-r', join(python_dir, 'modules'), 'crystax_python/crystax_python')
98101
shprint(sh.cp, '-r', self.ctx.get_python_install_dir(), 'crystax_python/crystax_python/site-packages')

0 commit comments

Comments
 (0)