gh-102029: Deprecate passing arguments to _PyRLock in threading (#102071)

This commit is contained in:
Nikita Sobolev 2023-08-17 19:19:07 +03:00 committed by GitHub
parent 0b243c2f66
commit 80f30cf51b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 0 deletions

View file

@ -4,6 +4,7 @@ import os as _os
import sys as _sys
import _thread
import functools
import warnings
from time import monotonic as _time
from _weakrefset import WeakSet
@ -116,6 +117,12 @@ def RLock(*args, **kwargs):
acquired it.
"""
if args or kwargs:
warnings.warn(
'Passing arguments to RLock is deprecated and will be removed in 3.15',
DeprecationWarning,
stacklevel=2,
)
if _CRLock is None:
return _PyRLock(*args, **kwargs)
return _CRLock(*args, **kwargs)