Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templater.py @ 47831:f3b1df44b716 stable
template: handle missing resource in `_readmapfile`
This fix the remaining issue in test-template-map.t.
Differential Revision: https://phab.mercurial-scm.org/D11288
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 18 Aug 2021 01:41:02 +0200 |
parents | 981cef5188c3 |
children | 2b76255a4f74 |
line wrap: on
line diff
--- a/mercurial/templater.py Wed Aug 18 01:10:40 2021 +0200 +++ b/mercurial/templater.py Wed Aug 18 01:41:02 2021 +0200 @@ -852,9 +852,12 @@ if not subresource: if pycompat.ossep not in rel: abs = rel - subresource = resourceutil.open_resource( - b'mercurial.templates', rel - ) + try: + subresource = resourceutil.open_resource( + b'mercurial.templates', rel + ) + except resourceutil.FileNotFoundError: + subresource = None else: dir = templatedir() if dir: