Mark '_compat.RLock' as Python 3.6 only
The threading module is no longer optional in Python 3.7+
MODIFY
src/urllib3/_collections.py
src/urllib3/_collections.py
@@ -38,7 +38,7 @@ if TYPE_CHECKING:
else:
try:
from threading import RLock
- except ImportError: # Platform-specific: No threads available
+ except ImportError: # Python 3.6
from ._compat import RLock

MODIFY
src/urllib3/_compat.py
src/urllib3/_compat.py
-class RLock:
+class RLock: # Python 3.6
# We shim out a context manager to be used as a compatibility layer
# if the system `threading` module doesn't have a real `RLock` available.
def __enter__(self) -> None:

Mark '_compat.RLock' as Python 3.6 only

The threading module is no longer optional in Python 3.7+