aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorXidorn Quan <me@upsuper.org>2018-03-07 17:22:12 +1100
committerXidorn Quan <me@upsuper.org>2018-03-07 17:22:12 +1100
commit4c240eb6325da2bae1e5431288b38bffb4b6a886 (patch)
tree2d4cdafc9067e13dfd5709da2401d61b6c5592f0 /python
parent29d9c85c5699e5039dcc7bf7f3a9296f8548ae9a (diff)
downloadservo-4c240eb6325da2bae1e5431288b38bffb4b6a886.tar.gz
servo-4c240eb6325da2bae1e5431288b38bffb4b6a886.zip
Don't import wptmanifest when in firefox tree.
Diffstat (limited to 'python')
-rw-r--r--python/tidy/servo_tidy/tidy.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py
index 2d0a2fc23f6..1dcdfd17849 100644
--- a/python/tidy/servo_tidy/tidy.py
+++ b/python/tidy/servo_tidy/tidy.py
@@ -30,12 +30,15 @@ wpt = os.path.join(topdir, "tests", "wpt")
def wpt_path(*args):
return os.path.join(wpt, *args)
-sys.path.append(wpt_path("web-platform-tests", "tools", "wptrunner", "wptrunner"))
-from wptmanifest import parser, node
-
CONFIG_FILE_PATH = os.path.join(".", "servo-tidy.toml")
WPT_MANIFEST_PATH = wpt_path("include.ini")
+# Import wptmanifest only when we do have wpt in tree, i.e. we're not
+# inside a Firefox checkout.
+if os.path.isfile(WPT_MANIFEST_PATH):
+ sys.path.append(wpt_path("web-platform-tests", "tools", "wptrunner", "wptrunner"))
+ from wptmanifest import parser, node
+
# Default configs
config = {
"skip-check-length": False,
@@ -1166,7 +1169,10 @@ def scan(only_changed_files=False, progress=True, stylo=False):
# check config file for errors
config_errors = check_config_file(CONFIG_FILE_PATH)
# check ini directories exist
- manifest_errors = check_manifest_dirs(WPT_MANIFEST_PATH)
+ if os.path.isfile(WPT_MANIFEST_PATH):
+ manifest_errors = check_manifest_dirs(WPT_MANIFEST_PATH)
+ else:
+ manifest_errors = ()
# check directories contain expected files
directory_errors = check_directory_files(config['check_ext'])
# standard checks