summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-08-15 14:33:45 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-08-15 17:02:12 +0000
commit5af964266f74593ebc3b1b1d70625232c49b74da (patch)
treea6d36f3c07554af1f3987495af22453abec34444
parent844cc74c2c2e43477fcbda7c471cfc6734f208ad (diff)
downloaddefinitions-5af964266f74593ebc3b1b1d70625232c49b74da.tar.gz
Check for empty strata earlier
Suggested by Richard Maw
-rw-r--r--morphlib/morphloader.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py
index 50aa9b38..db156921 100644
--- a/morphlib/morphloader.py
+++ b/morphlib/morphloader.py
@@ -259,6 +259,10 @@ class MorphologyLoader(object):
morph['system-kind'], morph.filename)
def _validate_stratum(self, morph):
+ # Require at least one chunk.
+ if len(morph.get('chunks', [])) == 0:
+ raise EmptyStratumError(morph['name'], morph.filename)
+
# All chunk names must be unique within a stratum.
names = set()
for spec in morph['chunks']:
@@ -285,10 +289,6 @@ class MorphologyLoader(object):
spec.get('alias', spec['name']),
morph.filename)
- # Require at least one chunk.
- if len(morph.get('chunks', [])) == 0:
- raise EmptyStratumError(morph['name'], morph.filename)
-
def _validate_chunk(self, morph):
pass