Skip to content

Commit 8e8a96d

Browse files
author
Doug Blank
committed
Close file properly
1 parent 7f30de1 commit 8e8a96d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jupyter_client/runapp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ def start(self):
106106
super(RunApp, self).start()
107107
for filename in self.filenames_to_run:
108108
self.log.debug("jupyter run: executing `%s`" % filename)
109-
cell = open(filename).read()
109+
with open(filename) as fp:
110+
cell = fp.read()
110111
self.run_cell(cell)
111112

112113
def run_cell(self, cell):

0 commit comments

Comments
 (0)