diff piecrust/sources/prose.py @ 394:65db6df28120

tests: Also mock `open` in Jinja to be able to use templates in bake tests. This also required raising the proper exception in the mock function. We are now raising `IOError` and set the `errno` attribute on it.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 17 May 2015 15:28:00 -0700
parents 4b1019bb2533
children 4850f8c21b6e
line wrap: on
line diff
--- a/piecrust/sources/prose.py	Sun May 17 15:26:46 2015 -0700
+++ b/piecrust/sources/prose.py	Sun May 17 15:28:00 2015 -0700
@@ -25,7 +25,7 @@
             path = os.path.join(self.fs_endpoint_path, rel_path)
             try:
                 c['title'] = get_first_line(path)
-            except OSError:
+            except IOError:
                 if mode == MODE_PARSING:
                     raise
         return c