summaryrefslogtreecommitdiff
path: root/lulua/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'lulua/util.py')
-rw-r--r--lulua/util.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lulua/util.py b/lulua/util.py
index c5634c2..5d7ea1b 100644
--- a/lulua/util.py
+++ b/lulua/util.py
@@ -30,7 +30,10 @@ def limit (l, n):
""" Limit the number of items drawn from iterable l to n. """
it = iter (l)
for i in range (n):
- yield next (it)
+ try:
+ yield next (it)
+ except StopIteration:
+ break
class YamlLoader:
"""