##// END OF EJS Templates
Fixed order of notebook loading and kernel starting....
Fixed order of notebook loading and kernel starting. For security reasons, the kernel should not be started until after the notebook content is completely loaded and on the page. This prevents people from creating notebooks that run nasty code on the users machine at load time. In order to implement this, we had to create a CodeCell.set_kernel method that allows the kernel attribute of a CodeCell to be set at a later time. This also fixes some error messages we were seeing related to the kernel's channels not being setup properly when a send was attempted.

File last commit:

r4734:e36691ad
r7197:ec9293e0
Show More
tclass.py
35 lines | 959 B | text/x-python | PythonLexer
"""Simple script to be run *twice*, to check reference counting bugs.
See test_run for details."""
from __future__ import print_function
import sys
# We want to ensure that while objects remain available for immediate access,
# objects from *previous* runs of the same script get collected, to avoid
# accumulating massive amounts of old references.
class C(object):
def __init__(self,name):
self.name = name
self.p = print
self.flush_stdout = sys.stdout.flush
def __del__(self):
self.p('tclass.py: deleting object:',self.name)
self.flush_stdout()
try:
name = sys.argv[1]
except IndexError:
pass
else:
if name.startswith('C'):
c = C(name)
#print >> sys.stderr, "ARGV:", sys.argv # dbg
# This next print statement is NOT debugging, we're making the check on a
# completely separate process so we verify by capturing stdout:
print('ARGV 1-:', sys.argv[1:])
sys.stdout.flush()