Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sapling: demandimport: Fix unknown python exception, module `threadin…
…g` has no attribute `Rlock` Summary: When using a recent version of python (3.12), running a sapling command returns the error `unknown python exception`: AttributeError: partially initialized module 'threading' has no attribute 'RLock' (most likely due to a circular import). This is caused by cpython breaking demandimport by importing `threading` locally in `importlib.util.LazyLoader.exec_module`. Adding `threading` along with `warnings`, and `_weakrefset` (which are imported by threading) to demandimport's ignore list resolves the issue. Refs: python/cpython#117983 https://repo.mercurial-scm.org/hg/file/63ede7a43a37/hgdemandimport/__init__.py https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076449 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076747
- Loading branch information