diff options
Diffstat (limited to 'system/tools/scripts/yapf_checker.py')
-rwxr-xr-x | system/tools/scripts/yapf_checker.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/system/tools/scripts/yapf_checker.py b/system/tools/scripts/yapf_checker.py index 62a753e7d7..34ab7f1e1c 100755 --- a/system/tools/scripts/yapf_checker.py +++ b/system/tools/scripts/yapf_checker.py @@ -38,10 +38,6 @@ def main(): logging.error('Missing PREUPLOAD_COMMIT in environment.') exit(1) - if ANDROID_BUILD_TOP_KEY not in os.environ: - logging.error('Missing ANDROID_BUILD_TOP in environment.') - exit(1) - # Gather changed Python files commit_id = os.environ[COMMIT_ID_ENV_KEY] full_git_command = GIT_COMMAND + ['-r', commit_id] @@ -50,6 +46,10 @@ def main(): if not full_files: return + if ANDROID_BUILD_TOP_KEY not in os.environ: + logging.error('Missing ANDROID_BUILD_TOP in environment.') + exit(1) + # Find yapf in Android code tree yapf_dir = os.path.join(os.environ[ANDROID_BUILD_TOP_KEY], DEFAULT_YAPF_DIR) yapf_binary = os.path.join(yapf_dir, 'yapf') |