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… (
#977) Summary: …g` has no attribute `Rlock` 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 Pull Request resolved: #977 Reviewed By: ahornby Differential Revision: D65039760 fbshipit-source-id: 134258735005cb6710cb3f33e3c23eb3a000bcb6
- Loading branch information