gh-118761: Always lazy import warnings in threading (#129428)

This commit is contained in:
Taneli Hukkinen 2025-01-29 19:24:37 +02:00 committed by GitHub
parent 49f24650e4
commit 99ed3025fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -3,7 +3,6 @@
import os as _os
import sys as _sys
import _thread
import warnings
from time import monotonic as _time
from _weakrefset import WeakSet
@ -133,6 +132,7 @@ def RLock(*args, **kwargs):
"""
if args or kwargs:
import warnings
warnings.warn(
'Passing arguments to RLock is deprecated and will be removed in 3.15',
DeprecationWarning,