diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py +++ b/mercurial/utils/procutil.py @@ -642,6 +642,14 @@ # Raising TypeError here is a little weird. But it is what the standard # library does. package = pycompat.sysstr(package) + + # Executable relative resources are distributed next to the executable + # in special locations, not as proper package resources. We need to handle + # them specially. + if package == r'mercurial' and executablerelativeresources(): + p = os.path.dirname(sys.executable) + return filesystemresourcereader(pycompat.fsencode(p)) + module = importlib.import_module(package) spec = getattr(module, '__spec__', None)