Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 99ed302

Browse filesBrowse files
authored
gh-118761: Always lazy import warnings in threading (#129428)
1 parent 49f2465 commit 99ed302
Copy full SHA for 99ed302

File tree

2 files changed

+3
-1
lines changed
Filter options

2 files changed

+3
-1
lines changed

‎Lib/threading.py

Copy file name to clipboardExpand all lines: Lib/threading.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import os as _os
44
import sys as _sys
55
import _thread
6-
import warnings
76

87
from time import monotonic as _time
98
from _weakrefset import WeakSet
@@ -133,6 +132,7 @@ def RLock(*args, **kwargs):
133132
134133
"""
135134
if args or kwargs:
135+
import warnings
136136
warnings.warn(
137137
'Passing arguments to RLock is deprecated and will be removed in 3.15',
138138
DeprecationWarning,
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Always lazy import ``warnings`` in :mod:`threading`. Patch by Taneli
2+
Hukkinen.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.