Skip to content

Commit 81cc942

Browse files
musicinmybrainauvipy
authored andcommitted
Adapt for logging lock internal changes in Python3.13
Fixes #403.
1 parent 8bffa2c commit 81cc942

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

billiard/util.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ def get_logger():
128128
global _logger
129129
import logging
130130

131-
logging._acquireLock()
131+
try:
132+
# Python 3.13+
133+
acquire, release = logging._prepareFork, logging._afterFork
134+
except AttributeError:
135+
acquire, release = logging._acquireLock, logging._releaseLock
136+
acquire()
132137
try:
133138
if not _logger:
134139

@@ -145,7 +150,7 @@ def get_logger():
145150
atexit._exithandlers.remove((_exit_function, (), {}))
146151
atexit._exithandlers.append((_exit_function, (), {}))
147152
finally:
148-
logging._releaseLock()
153+
release()
149154

150155
return _logger
151156

0 commit comments

Comments
 (0)