# HG changeset patch # User Augie Fackler # Date 1539963925 14400 # Node ID b015f30a91fb36f2a210711a8e6b32f32f674ddd # Parent 18da306e92b54608fb3c9cfd04610340bca3f0aa phabricator: do more of the VCR work in demandimport.deactivated() If I don't do this, VCR gets confused looking for pycurl and other libraries. I have no idea how this ever worked. Differential Revision: https://phab.mercurial-scm.org/D5159 diff -r 18da306e92b5 -r b015f30a91fb hgext/phabricator.py --- a/hgext/phabricator.py Fri Oct 19 11:28:29 2018 -0400 +++ b/hgext/phabricator.py Fri Oct 19 11:45:25 2018 -0400 @@ -131,14 +131,15 @@ with hgdemandimport.deactivated(): import vcr as vcrmod import vcr.stubs as stubs - vcr = vcrmod.VCR( - serializer=r'json', - custom_patches=[ - (urlmod, 'httpconnection', stubs.VCRHTTPConnection), - (urlmod, 'httpsconnection', stubs.VCRHTTPSConnection), - ]) - with vcr.use_cassette(cassette): - return fn(*args, **kwargs) + vcr = vcrmod.VCR( + serializer=r'json', + custom_patches=[ + (urlmod, 'httpconnection', stubs.VCRHTTPConnection), + (urlmod, 'httpsconnection', + stubs.VCRHTTPSConnection), + ]) + with vcr.use_cassette(cassette): + return fn(*args, **kwargs) return fn(*args, **kwargs) inner.__name__ = fn.__name__ return command(name, fullflags, spec)(inner)