Make gitpython and eventlet work with eventlet 0.25.1
Version 0.25 is having a bad interaction with python git. that is due to the way that eventlet unloads some modules now. Changed to use the inject method that supports what we need intead of the imported_patched that was having the problem Change-Id: I79894d4f711c64f536593fffcb6959df97c38838 Closes-bug: #1845181
This commit is contained in:
parent
33cb21a89b
commit
26672e83ab
|
@ -14,15 +14,15 @@
|
|||
# under the License.
|
||||
|
||||
|
||||
import eventlet
|
||||
from eventlet.green import subprocess
|
||||
import eventlet.patcher as patcher
|
||||
|
||||
# Due to an eventlet issue subprocess is not being correctly patched
|
||||
# on git module so it has to be done manually
|
||||
# on git.refs
|
||||
patcher.inject('git.refs', None, ('subprocess', subprocess), )
|
||||
|
||||
# this has to be loaded after the inject.
|
||||
|
||||
import git # noqa: E402
|
||||
|
||||
git = eventlet.import_patched('git', ('subprocess', subprocess))
|
||||
Repo = git.Repo
|
||||
|
||||
# git.refs is lazy loaded when there's a new commit, this needs to be
|
||||
# patched as well.
|
||||
eventlet.import_patched('git.refs')
|
||||
|
|
Loading…
Reference in New Issue