# HG changeset patch # User Martin von Zweigbergk # Date 2020-08-06 05:13:51 # Node ID 6e6fe826ba69d2bb138573fa0ec45431a000cb2e # Parent 1a4f925f72c3786ab1e659400ae4351a74d20f00 templater: replace Py3-only exception types by super-types available in Py2 As noted by @indygreg, `test-check-pyflakes.t` started failing on Py2 after my recent D8894, because that introduced catching of the Py3-only types `ModuleNotFoundError` and `FileNotFoundError`. Let's switch to less precise types that are also available in Py2. Differential Revision: https://phab.mercurial-scm.org/D8902 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