##// END OF EJS Templates
use pathlib.Path in demo.py
Samreen Zarroug -
Show More
@@ -184,6 +184,7 b' import re'
184 184 import shlex
185 185 import sys
186 186 import pygments
187 from pathlib import Path
187 188
188 189 from IPython.utils.text import marquee
189 190 from IPython.utils import openpy
@@ -403,8 +404,8 b' class Demo(object):'
403 404 index -= 1
404 405
405 406 filename = self.shell.mktempfile(self.src_blocks[index])
406 self.shell.hooks.editor(filename,1)
407 with open(filename, 'r') as f:
407 self.shell.hooks.editor(filename, 1)
408 with open(Path(filename), "r") as f:
408 409 new_block = f.read()
409 410 # update the source and colored block
410 411 self.src_blocks[index] = new_block
General Comments 0
You need to be logged in to leave comments. Login now