##// END OF EJS Templates
Use run_cell for %paste, instead of plain exec....
Thomas Kluyver -
Show More
@@ -3246,7 +3246,7 b' Defaulting color scheme to \'NoColor\'"""'
3246 if not par:
3246 if not par:
3247 b = textwrap.dedent(block)
3247 b = textwrap.dedent(block)
3248 self.user_ns['pasted_block'] = b
3248 self.user_ns['pasted_block'] = b
3249 exec b in self.user_ns
3249 self.run_cell(b)
3250 else:
3250 else:
3251 self.user_ns[par] = SList(block.splitlines())
3251 self.user_ns[par] = SList(block.splitlines())
3252 print "Block assigned to '%s'" % par
3252 print "Block assigned to '%s'" % par
@@ -316,6 +316,7 b' def check_cpaste(code, should_fail=False):'
316 _ip.user_ns['code_ran'] = False
316 _ip.user_ns['code_ran'] = False
317
317
318 src = StringIO()
318 src = StringIO()
319 src.encoding = None # IPython expects stdin to have an encoding attribute
319 src.write('\n')
320 src.write('\n')
320 src.write(code)
321 src.write(code)
321 src.write('\n--\n')
322 src.write('\n--\n')
General Comments 0
You need to be logged in to leave comments. Login now