# HG changeset patch # User cmlenz # Date 1156172106 0 # Node ID 00212b14903d9bba25f7747755c7fb0f913f0a55 # Parent 7f96149f28d53516a3d2742d811c9244fd76f21d Fix control flow for error message when template search path is empty. diff --git a/markup/template.py b/markup/template.py --- 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)