diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -1107,5 +1107,5 @@ def open_template(name, templatepath=Non name, resourceutil.open_resource(package_name, name_parts[-1]), ) - except (ModuleNotFoundError, FileNotFoundError): + except (ImportError, OSError): return None, None