Blob Blame History Raw
diff --git a/mkdocs/config/config_options.py b/mkdocs/config/config_options.py
index d5e656f..4e011e7 100644
--- a/mkdocs/config/config_options.py
+++ b/mkdocs/config/config_options.py
@@ -363,7 +363,7 @@ class Extras(OptionallyRequired):
     def walk_docs_dir(self, docs_dir):
 
         if self.file_match is None:
-            raise StopIteration
+            return
 
         for (dirpath, dirs, filenames) in os.walk(docs_dir):
             dirs.sort()
diff --git a/mkdocs/nav.py b/mkdocs/nav.py
index fb092e6..383780e 100644
--- a/mkdocs/nav.py
+++ b/mkdocs/nav.py
@@ -262,7 +262,7 @@ def _follow(config_line, url_context, use_dir_urls, header=None, title=None):
             header.children.append(page)
 
         yield page
-        raise StopIteration
+        return
 
     elif not isinstance(config_line, dict):
         msg = ("Line in 'page' config is of type {0}, dict or string "
@@ -275,7 +275,7 @@ def _follow(config_line, url_context, use_dir_urls, header=None, title=None):
             "config contains an invalid entry: {0}".format(config_line))
     elif len(config_line) == 0:
         log.warning("Ignoring empty line in the pages config.")
-        raise StopIteration
+        return
 
     next_cat_or_title, subpages_or_path = next(iter(config_line.items()))
 
@@ -283,7 +283,7 @@ def _follow(config_line, url_context, use_dir_urls, header=None, title=None):
         path = subpages_or_path
         for sub in _follow(path, url_context, use_dir_urls, header=header, title=next_cat_or_title):
             yield sub
-        raise StopIteration
+        return
 
     elif not isinstance(subpages_or_path, list):
         msg = ("Line in 'page' config is of type {0}, list or string "