summaryrefslogtreecommitdiff
path: root/morphlib
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2016-03-03 10:27:03 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2016-03-03 10:34:59 +0000
commitbb139ecf1b9de3b221ff1d93c26190a8623d5d33 (patch)
treebf642e6aa93bb1f7a69e407baa29a66435d73156 /morphlib
parent7067e405a7dad7976a9b7d61ed67fb8bb5042d3c (diff)
downloadmorph-bb139ecf1b9de3b221ff1d93c26190a8623d5d33.tar.gz
Fix some test failures
These seem to have been introduced by commit fb6dd955cbc7081f47dc4391. Change-Id: I2fb0be5f8829722264f3509f4db9473d19ea2939
Diffstat (limited to 'morphlib')
-rw-r--r--morphlib/morphloader.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py
index 1158155c..668b133e 100644
--- a/morphlib/morphloader.py
+++ b/morphlib/morphloader.py
@@ -597,11 +597,14 @@ class MorphologyLoader(object):
@classmethod
def _validate_commands(cls, morphology_name, key, commands, errors):
- for cmd_index, cmd in enumerate(commands):
- if not isinstance(cmd, basestring):
- e = InvalidTypeError('%s[%d]' % (key, cmd_index),
- str, type(cmd), morphology_name)
- errors.append(e)
+ if commands is None:
+ return
+
+ for cmd_index, cmd in enumerate(commands): # pragma: no cover
+ if not isinstance(cmd, basestring):
+ e = InvalidTypeError('%s[%d]' % (key, cmd_index),
+ str, type(cmd), morphology_name)
+ errors.append(e)
@classmethod
def _validate_products(cls, morphology_name, products, errors):