Monkey-patching vs. PyCharm Debugger
In PyCharm, programs with monkey patching enabled cannot be debugged. The debugger says Connecting, then Disconnecting about a second later. Here is a simple example to demonstrate the problem:
from gevent import monkey; monkey.patch_all()
import DNS; DNS.DiscoverNameServers()
def getMX(url):
mx_hosts = DNS.mxlookup(url);
print mx_hosts, '(', url, ')'
if __name__ == '__main__':
getMX("gmail.com")
Please sign in to leave a comment.
Until Jetbrains fixes this, I found an easy workaround. Just paste the following at the top of your pydev.py file (in your PyCharm installation directory):