Skip to content

Commit 5a3ed06

Browse files
authored
Merge pull request kivy#1289 from inclement/check_system_python
Made hostpython3crystax check if system python is available
2 parents 74bf788 + 2284ecb commit 5a3ed06

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pythonforandroid/recipes/hostpython3crystax/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55

66
class Hostpython3Recipe(Recipe):
7-
version = '3.5'
8-
# url = 'http://python.org/ftp/python/{version}/Python-{version}.tgz'
9-
# url = 'https://github.com/crystax/android-vendor-python-3-5/archive/master.zip'
7+
version = 'auto' # the version is taken from the python3crystax recipe
108
name = 'hostpython3crystax'
119

1210
conflicts = ['hostpython2']
@@ -36,6 +34,10 @@ def build_arch(self, arch):
3634
shprint(sh.mkdir, '-p', sub_build_dir)
3735
python3crystax = self.get_recipe('python3crystax', self.ctx)
3836
system_python = sh.which("python" + python3crystax.version)
37+
if system_python is None:
38+
raise OSError(
39+
('Trying to use python3crystax=={} but this Python version '
40+
'is not installed locally.').format(python3crystax.version))
3941
link_dest = join(self.get_build_dir(), 'hostpython')
4042
shprint(sh.ln, '-sf', system_python, link_dest)
4143

0 commit comments

Comments
 (0)