Skip to content

Commit

Permalink
Merge pull request #1021 from 00Kai0/master
Browse files Browse the repository at this point in the history
kwargs is used when km is exist, but not defind in func.
  • Loading branch information
MSeal committed May 12, 2019
2 parents e9d82f4 + 4140b66 commit 8af6aac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nbconvert/preprocessors/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def start_new_kernel(self, **kwargs):
return km, kc

@contextmanager
def setup_preprocessor(self, nb, resources, km=None):
def setup_preprocessor(self, nb, resources, km=None, **kwargs):
"""
Context manager for setting up the class to execute a notebook.
Expand Down Expand Up @@ -321,7 +321,8 @@ def setup_preprocessor(self, nb, resources, km=None):
self.widget_buffers = {}

if km is None:
self.km, self.kc = self.start_new_kernel(cwd=path)
kwargs["cwd"] = path
self.km, self.kc = self.start_new_kernel(**kwargs)
try:
# Yielding unbound args for more easier understanding and downstream consumption
yield nb, self.km, self.kc
Expand Down

0 comments on commit 8af6aac

Please sign in to comment.