diff --git a/IPython/kernel/contexts.py b/IPython/kernel/contexts.py index 040102b..7ca51db 100644 --- a/IPython/kernel/contexts.py +++ b/IPython/kernel/contexts.py @@ -144,35 +144,37 @@ class RemoteMultiEngine(RemoteContextBase): # XXX - Temporary hackish testing, we'll move this into proper tests right -# away - -if __name__ == '__main__': - - # XXX - for now, we need a running cluster to be started separately. The - # daemon work is almost finished, and will make much of this unnecessary. - from IPython.kernel import client - mec = client.MultiEngineClient(('127.0.0.1',10105)) - - try: - mec.get_ids() - except ConnectionRefusedError: - import os, time - os.system('ipcluster -n 2 &') - time.sleep(2) - mec = client.MultiEngineClient(('127.0.0.1',10105)) - - mec.block = False - - import itertools - c = itertools.count() - - parallel = RemoteMultiEngine(mec) - - with parallel as pr: - # A comment - remote() # this means the code below only runs remotely - print 'Hello remote world' - x = 3.14 - # Comments are OK - # Even misindented. - y = x+1 +# away. This has been commented out as it doesn't run under Python 2.4 +# because of the usage of the with statement below. We need to protect +# such things with a try:except. + +# if __name__ == '__main__': +# +# # XXX - for now, we need a running cluster to be started separately. The +# # daemon work is almost finished, and will make much of this unnecessary. +# from IPython.kernel import client +# mec = client.MultiEngineClient(('127.0.0.1',10105)) +# +# try: +# mec.get_ids() +# except ConnectionRefusedError: +# import os, time +# os.system('ipcluster -n 2 &') +# time.sleep(2) +# mec = client.MultiEngineClient(('127.0.0.1',10105)) +# +# mec.block = False +# +# import itertools +# c = itertools.count() +# +# parallel = RemoteMultiEngine(mec) +# +# with parallel as pr: +# # A comment +# remote() # this means the code below only runs remotely +# print 'Hello remote world' +# x = 3.14 +# # Comments are OK +# # Even misindented. +# y = x+1