Created
September 15, 2013 16:18
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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