Function which performs eventlet monkey patching and also takes into account "--use-debugger" argument in the command line arguments. If this argument is found, no monkey patching is performed for the thread module. This allows user to use remote debuggers. :param patch_thread
(patch_thread=None)
| 34 | |
| 35 | |
| 36 | def monkey_patch(patch_thread=None): |
| 37 | """ |
| 38 | Function which performs eventlet monkey patching and also takes into account "--use-debugger" |
| 39 | argument in the command line arguments. |
| 40 | |
| 41 | If this argument is found, no monkey patching is performed for the thread module. This allows |
| 42 | user to use remote debuggers. |
| 43 | |
| 44 | :param patch_thread: True to also patch the thread module. If not provided, thread module is |
| 45 | patched unless debugger is used. |
| 46 | :type patch_thread: ``bool`` |
| 47 | """ |
| 48 | import eventlet |
| 49 | |
| 50 | if patch_thread is None: |
| 51 | patch_thread = not is_use_debugger_flag_provided() |
| 52 | |
| 53 | # TODO: support gevent.patch_all if .concurrency.CONCURRENCY_LIBRARY = "gevent" |
| 54 | eventlet.monkey_patch( |
| 55 | os=True, select=True, socket=True, thread=patch_thread, time=True |
| 56 | ) |
| 57 | |
| 58 | |
| 59 | def use_select_poll_workaround(nose_only=True): |
no test coverage detected