# HG changeset patch # User Ludovic Chabant # Date 1437983275 25200 # Node ID 73bd408caebc6b9a95f56507fd55a211af283253 # Parent 16e705c58cae860b7d000cd2422cb191c8037bdd internal: Return `None` instead of raising an exception when finding pages. This makes the `posts` source behave like the other ones. diff -r 16e705c58cae -r 73bd408caebc piecrust/sources/posts.py --- a/piecrust/sources/posts.py Sun Jul 26 23:16:15 2015 -0700 +++ b/piecrust/sources/posts.py Mon Jul 27 00:47:55 2015 -0700 @@ -9,7 +9,6 @@ MODE_CREATING, MODE_PARSING) from piecrust.sources.interfaces import IPreparingSource from piecrust.sources.mixins import SimplePaginationSourceMixin -from piecrust.sources.pageref import PageNotFoundError logger = logging.getLogger(__name__) @@ -88,10 +87,10 @@ raise ValueError("Not enough information to find a post path.") possible_paths = glob.glob(path) if len(possible_paths) != 1: - raise PageNotFoundError() + return None path = possible_paths[0] elif mode == MODE_PARSING and not os.path.isfile(path): - raise PageNotFoundError(path) + return None rel_path = os.path.relpath(path, self.fs_endpoint_path) rel_path = rel_path.replace('\\', '/')