Skip to content

Instantly share code, notes, and snippets.

@paulgb
Created September 15, 2013 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulgb/6572133 to your computer and use it in GitHub Desktop.
Save paulgb/6572133 to your computer and use it in GitHub Desktop.
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()
km.start_kernel()
kc = km.client()
kc.start_channels()
iopub = kc.iopub_channel
shell = kc.shell_channel
#sleep(1)
shell.execute('print "hello world"')
print shell.get_msg(timeout=1)
print iopub.get_msg(timeout=1)
if __name__ == '__main__':
racecondition()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment