changeset 176:00212b14903d trunk

Fix control flow for error message when template search path is empty.
author cmlenz
date Mon, 21 Aug 2006 14:55:06 +0000
parents 7f96149f28d5
children 553866249cb0
files markup/template.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/markup/template.py
+++ b/markup/template.py
@@ -1101,6 +1101,9 @@
         if os.path.isabs(filename):
             search_path = [os.path.dirname(filename)]
 
+        if not search_path:
+            raise TemplateError('Search path for templates not configured')
+
         for dirname in search_path:
             filepath = os.path.join(dirname, filename)
             try:
@@ -1115,7 +1118,5 @@
                 return tmpl
             except IOError:
                 continue
-        else:
-            raise TemplateError('Search path for templates not configured')
 
         raise TemplateNotFound(filename, self.search_path)
Copyright (C) 2012-2017 Edgewall Software