# HG changeset patch # User Matt Harbison # Date 2022-11-02 18:23:09 # Node ID 5f22c92dcf3d1a78a76941792572156efdce6a48 # Parent fc719967efd0be42bc8771baf196035b7b1a1aff demandimport: convert ignored modules from bytes -> str in extensions The default list of ignored modules are str, and test for bypassing the lazy import is `module.__name__ in ignores`, so these were effectively NOT ignored. Most of these date back to the grand byteification in 687b865b95ad, with some subsequent additions that followed the existing example. I have no idea if these modules in fact need to bypass lazy importing, but at least it follows the intent of the code. diff --git a/hgext/convert/bzr.py b/hgext/convert/bzr.py --- a/hgext/convert/bzr.py +++ b/hgext/convert/bzr.py @@ -23,9 +23,9 @@ from . import common # these do not work with demandimport, blacklist demandimport.IGNORES.update( [ - b'breezy.transactions', - b'breezy.urlutils', - b'ElementPath', + 'breezy.transactions', + 'breezy.urlutils', + 'ElementPath', ] ) diff --git a/hgext/highlight/highlight.py b/hgext/highlight/highlight.py --- a/hgext/highlight/highlight.py +++ b/hgext/highlight/highlight.py @@ -11,7 +11,7 @@ from mercurial import demandimport -demandimport.IGNORES.update([b'pkgutil', b'pkg_resources', b'__main__']) +demandimport.IGNORES.update(['pkgutil', 'pkg_resources', '__main__']) from mercurial import ( encoding,