From d036610974f229a806d682c6d051c299f6396d2f Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 14 Feb 2014 13:24:07 +0000 Subject: yarns: Ensure machine altered morphologies don't include repo/ref --- scripts/yaml-extract | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/yaml-extract b/scripts/yaml-extract index 5a945b6d..6f55e62f 100755 --- a/scripts/yaml-extract +++ b/scripts/yaml-extract @@ -28,7 +28,7 @@ # values for missing fields (e.g., the morph field if name is given). # Construct your tests accordingly. -# Copyright (C) 2013 Codethink Limited +# Copyright (C) 2013-2014 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -52,6 +52,8 @@ with open(sys.argv[1]) as f: obj = yaml.safe_load(f) for thing in sys.argv[2:]: if type(obj) == dict: + if thing not in obj: + raise Exception("Object does not contain %s" % thing) obj = obj[thing] elif type(obj) == list: if '=' in thing: -- cgit v1.2.1