##// END OF EJS Templates
Apply suggestions from code review...
Matthias Bussonnier -
Show More
@@ -513,8 +513,7 b' class CodeMagics(Magics):'
513 self.shell.hooks.editor(filename)
513 self.shell.hooks.editor(filename)
514
514
515 # and make a new macro object, to replace the old one
515 # and make a new macro object, to replace the old one
516 with Path(filename).open() as mfile:
516 mvalue = Path(filename).read_text()
517 mvalue = mfile.read()
518 self.shell.user_ns[mname] = Macro(mvalue)
517 self.shell.user_ns[mname] = Macro(mvalue)
519
518
520 @skip_doctest
519 @skip_doctest
@@ -704,8 +703,7 b' class CodeMagics(Magics):'
704 # XXX TODO: should this be generalized for all string vars?
703 # XXX TODO: should this be generalized for all string vars?
705 # For now, this is special-cased to blocks created by cpaste
704 # For now, this is special-cased to blocks created by cpaste
706 if args.strip() == 'pasted_block':
705 if args.strip() == 'pasted_block':
707 with filepath.open('r') as f:
706 self.shell.user_ns['pasted_block'] = filepath.read_text()
708 self.shell.user_ns['pasted_block'] = f.read()
709
707
710 if 'x' in opts: # -x prevents actual execution
708 if 'x' in opts: # -x prevents actual execution
711 print()
709 print()
General Comments 0
You need to be logged in to leave comments. Login now