Skip to content

Instantly share code, notes, and snippets.

Created September 15, 2013 16:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A race condition in IPython under Mac OS Darwin. iopub.get_msg fails unless sleep(1) is uncommented.
from IPython.kernel import KernelManager
from time import sleep
def racecondition():
km = KernelManager()
kc = km.client()
iopub = kc.iopub_channel
shell = kc.shell_channel
shell.execute('print "hello world"')
print shell.get_msg(timeout=1)
print iopub.get_msg(timeout=1)
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment