Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
Monkey patch original current_thread _active
Browse files Browse the repository at this point in the history
Monkey patch the original current_thread to use the up-to-date _active
global variable. This solution is based on that documented at:
eventlet/eventlet#592

Also disable E402 to allow the change in.

Change-Id: I508fcd0707ecdd2bf720303f6cbb4087a38aaadd
Closes-Bug: #1863021
  • Loading branch information
Corey Bryant authored and teferi committed May 5, 2020
1 parent 590227b commit fe543a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions murano/monkey_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@
eventlet.monkey_patch(os=False)
else:
eventlet.monkey_patch()
# Monkey patch the original current_thread to use the up-to-date _active
# global variable. See https://bugs.launchpad.net/bugs/1863021 and
# https://github.com/eventlet/eventlet/issues/592
import __original_module_threading as orig_threading
import threading # noqa
orig_threading.current_thread.__globals__['_active'] = threading._active
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ whitelist_externals = rm
show-source = true
builtins = _
# W605 invalid escape sequence
ignore = W605,W504,W503,E123,H405
# E402 fires an error on eventlet import. Should probably remove condition alltogether
ignore = W605,W504,W503,E123,H405,E402
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build

[hacking]
Expand Down

0 comments on commit fe543a6

Please sign in to comment.