Pass nbformat object to write call to save .py script

Closes gh-4495
This commit is contained in:
Thomas Kluyver 2013-11-05 17:35:36 -08:00
parent 4ee44b3871
commit 8ed3a725f3

View File

@ -251,7 +251,7 @@ class FileNotebookManager(NotebookManager):
self.log.debug("Writing script %s", py_path)
try:
with io.open(py_path, 'w', encoding='utf-8') as f:
current.write(model, f, u'py')
current.write(nb, f, u'py')
except Exception as e:
raise web.HTTPError(400, u'Unexpected error while saving notebook as script: %s %s' % (py_path, e))