changeset 45319:6e6fe826ba69

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
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 05 Aug 2020 22:13:51 -0700
parents 1a4f925f72c3
children 4aa484efc926
files mercurial/templater.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templater.py	Wed Aug 05 14:19:42 2020 -0700
+++ b/mercurial/templater.py	Wed Aug 05 22:13:51 2020 -0700
@@ -1107,5 +1107,5 @@
                 name,
                 resourceutil.open_resource(package_name, name_parts[-1]),
             )
-        except (ModuleNotFoundError, FileNotFoundError):
+        except (ImportError, OSError):
             return None, None