File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -176,17 +176,17 @@ def addLevelName(level, levelName):
176
176
#the lock would already have been acquired - so we need an RLock.
177
177
#The same argument applies to Loggers and Manager.loggerDict.
178
178
#
179
- _lock = None
179
+ if thread :
180
+ _lock = threading .RLock ()
181
+ else :
182
+ _lock = None
180
183
181
184
def _acquireLock ():
182
185
"""
183
186
Acquire the module-level lock for serializing access to shared data.
184
187
185
188
This should be released with _releaseLock().
186
189
"""
187
- global _lock
188
- if (not _lock ) and thread :
189
- _lock = threading .RLock ()
190
190
if _lock :
191
191
_lock .acquire ()
192
192
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ Core and builtins
18
18
Library
19
19
-------
20
20
21
+ - Issue #7403: logging: Fixed possible race condition in lock creation.
22
+
21
23
- Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
22
24
forever on incomplete input. That caused tarfile.open() to hang when used
23
25
with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
You can’t perform that action at this time.
0 commit comments