Fix detection of gevent threading.local monkey-patch#447
Merged
untitaker merged 3 commits intoAug 6, 2019
Conversation
The `_` in `_threading` seems like a mistake and always returns False.
Removing it leads to the detection working properly:
```py
Python 3.7.4 (default, Jul 16 2019, 07:12:58)
[GCC 9.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gevent.monkey
>>> gevent.monkey.is_object_patched('_threading', 'local')
False
>>> gevent.monkey.is_object_patched('threading', 'local')
False
>>> gevent.monkey.patch_all()
True
>>> gevent.monkey.is_object_patched('_threading', 'local')
False
>>> gevent.monkey.is_object_patched('threading', 'local')
True
```
Contributor
Author
|
We are using gevent and are seeing some data "leaking" between events. I hope this will fix the problem, but I did not verify it. |
Member
|
Thanks! |
bluetech
commented
Aug 6, 2019
|
|
||
|
|
||
| def test_gevent_is_patched(): | ||
| gevent.monkey.patch_all() |
Contributor
Author
There was a problem hiding this comment.
I wonder, does this not affect all of the subsequent tests in the test run?
Member
There was a problem hiding this comment.
We run each test in its own subprocess because the SDK itself is already so heavy on monkeypatching.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
_in_threadingseems like a mistake and always returns False.Removing it leads to the detection working properly: