Merge pull request #721 from inclement/fix_file_read

Improved error handling if p4a setup.py can't be read
This commit is contained in:
Mathieu Virbel 2018-10-24 10:21:46 +02:00 committed by GitHub
commit 0abbee5661
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -523,8 +523,10 @@ class TargetAndroid(Target):
setup = fd.read()
deps = re.findall("^install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[0]
deps = ast.literal_eval(deps)
except Exception:
deps = []
except IOError:
self.buildozer.error('Failed to read python-for-android setup.py at {}'.format(
join(self.pa_dir, 'setup.py')))
exit(1)
pip_deps = []
for dep in deps:
pip_deps.append("'{}'".format(dep))