Mercurial > public > mercurial-scm > hg
comparison mercurial/utils/resourceutil.py @ 48008:c0588d389c5f
typing: suppress an import-error warning in `mercurial/utils/resourceutil.py`
Newly caught by pytype 2021-09-09.
Differential Revision: https://phab.mercurial-scm.org/D11468
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 20 Sep 2021 10:44:25 -0400 |
parents | 08f16b3331df |
children | 6000f5b25c9b |
comparison
equal
deleted
inserted
replaced
48007:28c62f83b652 | 48008:c0588d389c5f |
---|---|
55 | 55 |
56 | 56 |
57 try: | 57 try: |
58 # importlib.resources exists from Python 3.7; see fallback in except clause | 58 # importlib.resources exists from Python 3.7; see fallback in except clause |
59 # further down | 59 # further down |
60 from importlib import resources | 60 from importlib import resources # pytype: disable=import-error |
61 | 61 |
62 # Force loading of the resources module | 62 # Force loading of the resources module |
63 resources.open_binary # pytype: disable=module-attr | 63 resources.open_binary # pytype: disable=module-attr |
64 | 64 |
65 except (ImportError, AttributeError): | 65 except (ImportError, AttributeError): |