From 99b312a7323c3277584109b39247364f50904c5d Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Sat, 4 Jun 2016 22:52:29 +0100 Subject: [PATCH] Fixed error messages when build vars aren't set --- pythonforandroid/build.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pythonforandroid/build.py b/pythonforandroid/build.py index c2b37af5e4..11b00403e0 100644 --- a/pythonforandroid/build.py +++ b/pythonforandroid/build.py @@ -121,7 +121,7 @@ def android_api(self, value): def ndk_ver(self): '''The version of the NDK being used for compilation.''' if self._ndk_ver is None: - raise ValueError('Tried to access android_api but it has not ' + raise ValueError('Tried to access ndk_ver but it has not ' 'been set - this should not happen, something ' 'went wrong!') return self._ndk_ver @@ -134,7 +134,7 @@ def ndk_ver(self, value): def sdk_dir(self): '''The path to the Android SDK.''' if self._sdk_dir is None: - raise ValueError('Tried to access android_api but it has not ' + raise ValueError('Tried to access sdk_dir but it has not ' 'been set - this should not happen, something ' 'went wrong!') return self._sdk_dir @@ -147,7 +147,7 @@ def sdk_dir(self, value): def ndk_dir(self): '''The path to the Android NDK.''' if self._ndk_dir is None: - raise ValueError('Tried to access android_api but it has not ' + raise ValueError('Tried to access ndk_dir but it has not ' 'been set - this should not happen, something ' 'went wrong!') return self._ndk_dir @@ -314,6 +314,7 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir, 'need to manually set the NDK ver.') if ndk_ver is None: warning('Android NDK version could not be found, exiting.') + exit(1) self.ndk_ver = ndk_ver info('Using {} NDK {}'.format(self.ndk.capitalize(), self.ndk_ver))