As of GH-118793, the warnings module is used only once in pathlib, by PurePath.is_reserved(). We should be able to move the import warnings line into that method. But beware! Doing so seems to cause a failure in test_io, which needs further investigation.
Linked PRs
As of GH-118793, the
warningsmodule is used only once in pathlib, byPurePath.is_reserved(). We should be able to move theimport warningsline into that method. But beware! Doing so seems to cause a failure intest_io, which needs further investigation.Linked PRs
GET_WARNINGS_ATTR#119063import warningsinpathlib._locals#119111