Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
49848:139f713010ea | 49849:de9ffb82ef4d |
---|---|
284 if vcr: | 284 if vcr: |
285 cassette = pycompat.fsdecode(vcr) | 285 cassette = pycompat.fsdecode(vcr) |
286 import hgdemandimport | 286 import hgdemandimport |
287 | 287 |
288 with hgdemandimport.deactivated(): | 288 with hgdemandimport.deactivated(): |
289 # pytype: disable=import-error | |
289 import vcr as vcrmod | 290 import vcr as vcrmod |
290 import vcr.stubs as stubs | 291 import vcr.stubs as stubs |
292 | |
293 # pytype: enable=import-error | |
291 | 294 |
292 vcr = vcrmod.VCR( | 295 vcr = vcrmod.VCR( |
293 serializer='json', | 296 serializer='json', |
294 before_record_request=sanitiserequest, | 297 before_record_request=sanitiserequest, |
295 before_record_response=sanitiseresponse, | 298 before_record_response=sanitiseresponse, |