Skip to content

Commit 56f06f1

Browse files
committed
Change to pathlib read method
1 parent a83d8ea commit 56f06f1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

jupyter_sphinx/ast.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ def run(self):
102102
location=location,
103103
)
104104
try:
105-
with open(filename) as f:
106-
content = [line.rstrip() for line in f.readlines()]
105+
content = [line.rstrip() for line in Path(filename).read_text()]
107106
except (IOError, OSError):
108107
raise IOError("File {} not found or reading it failed".format(filename))
109108
else:

0 commit comments

Comments
 (0)