Search code examples
pythonmonkeypatchinggevent

Gevent monkey unpatch


I'm doing my program in many steps. One of them is to use gevent + monkey patch

from gevent import monkey; monkey.patch_all()

Everything works great. But can i unpatch it after i'm done using it ? I want to return to my default socket functions.


Solution

  • reload(socket)
    

    This blog post has a pretty good write up of the solution here: https://emptysqua.re/blog/undoing-gevents-monkey-patching/