patcher: green existing locks fail (Python3)
Introduced in #309, this enumeration should be over the items of the dict in order to work correctly. https://github.com/eventlet/eventlet/pull/356 https://github.com/eventlet/eventlet/pull/309
This commit is contained in:

committed by
Sergey Shepelev

parent
f508a7e330
commit
32e2c335fb
@@ -372,9 +372,14 @@ def _fix_py3_rlock(old):
|
|||||||
new.acquire()
|
new.acquire()
|
||||||
gc.collect()
|
gc.collect()
|
||||||
for ref in gc.get_referrers(old):
|
for ref in gc.get_referrers(old):
|
||||||
for k, v in vars(ref):
|
try:
|
||||||
if v == old:
|
ref_vars = vars(ref)
|
||||||
setattr(ref, k, new)
|
except TypeError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
for k, v in ref_vars.items():
|
||||||
|
if v == old:
|
||||||
|
setattr(ref, k, new)
|
||||||
|
|
||||||
|
|
||||||
def _green_os_modules():
|
def _green_os_modules():
|
||||||
|
Reference in New Issue
Block a user