diff --git a/nbconvert/exporters/templateexporter.py b/nbconvert/exporters/templateexporter.py index c09e6583b..16fbf0a17 100644 --- a/nbconvert/exporters/templateexporter.py +++ b/nbconvert/exporters/templateexporter.py @@ -151,7 +151,11 @@ class TemplateExporter(Exporter): """ # finish the docstring - __doc__ = __doc__.format(filters="- " + "\n - ".join(sorted(default_filters.keys()))) + __doc__ = ( + __doc__.format(filters="- " + "\n - ".join(sorted(default_filters.keys()))) + if __doc__ + else None + ) _template_cached = None