Skip to content

Commit

Permalink
Yet another disgusting hack for python 3.11.2 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Mar 7, 2023
1 parent 53ba003 commit 9f73cd5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions qubesadmin/backup/restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,19 @@ def _fix_threading_after_fork():
otherwise atexit callback will crash.
https://github.com/python/cpython/issues/88110
And initialize DummyThread locks:
https://github.com/python/cpython/issues/102512
"""
# pylint: disable=protected-access
concurrent.futures.thread._threads_queues.clear()
thread = threading.current_thread()
if isinstance(thread, threading._DummyThread) and \
getattr(thread, '_tstate_lock', "missing") is None:
# mimic threading._after_fork()
thread._set_tstate_lock()
thread._tstate_lock.acquire()



class ExtractWorker3(Process):
Expand Down

0 comments on commit 9f73cd5

Please sign in to comment.