From 88c94f285eca66c62678b8f847d6a4f38ea53e3c Mon Sep 17 00:00:00 2001 From: askeing Date: Sun, 17 Apr 2016 03:27:50 +0900 Subject: Check the "tests/wpt/web-platform-tests" folder before loading "tools.lint" module --- python/tidy/servo_tidy/tidy.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'python/tidy/servo_tidy/tidy.py') diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index 43c4eb6dc69..56c07aeae6b 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -601,11 +601,12 @@ def get_wpt_files(only_changed_files, progress): def check_wpt_lint_errors(files): wpt_working_dir = os.path.abspath(os.path.join(".", "tests", "wpt", "web-platform-tests")) - site.addsitedir(wpt_working_dir) - from tools.lint import lint - returncode = lint.lint(files) - if returncode: - yield ("WPT Lint Tool", "", "lint error(s) in Web Platform Tests: exit status {0}".format(returncode)) + if os.path.isdir(wpt_working_dir): + site.addsitedir(wpt_working_dir) + from tools.lint import lint + returncode = lint.lint(files) + if returncode: + yield ("WPT Lint Tool", "", "lint error(s) in Web Platform Tests: exit status {0}".format(returncode)) def get_file_list(directory, only_changed_files=False, exclude_dirs=[]): -- cgit v1.2.3