diff hgext/phabricator.py @ 49849:de9ffb82ef4d

typing: suppress a bunch of potential import-error cases in extensions As flagged by pytype locally. Either the ImportError is locally handled, or the imported module was previously determined to be present by `hgave` (for the phabricator extension), or is handled by the `hgext.convert.subversion` module when imported (for the `hgext.convert.transport` module).
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 06 Jan 2023 13:04:50 -0500
parents 642e31cb55f0
children 92743e6d1a0c
line wrap: on
line diff
--- a/hgext/phabricator.py	Thu Jan 05 00:09:48 2023 -0500
+++ b/hgext/phabricator.py	Fri Jan 06 13:04:50 2023 -0500
@@ -286,9 +286,12 @@
                 import hgdemandimport
 
                 with hgdemandimport.deactivated():
+                    # pytype: disable=import-error
                     import vcr as vcrmod
                     import vcr.stubs as stubs
 
+                    # pytype: enable=import-error
+
                     vcr = vcrmod.VCR(
                         serializer='json',
                         before_record_request=sanitiserequest,