--- a/src/eric7/QScintilla/DocstringGenerator/BaseDocstringGenerator.py Wed Dec 20 19:28:22 2023 +0100 +++ b/src/eric7/QScintilla/DocstringGenerator/BaseDocstringGenerator.py Thu Dec 21 12:03:40 2023 +0100 @@ -7,6 +7,7 @@ Module implementing a docstring generator base class. """ +import contextlib import importlib import re @@ -139,6 +140,7 @@ @param functionInfo reference to the function info object @type FunctionInfo @param docstringType kind of docstring to be generated + @type str @return list of docstring lines @rtype str """ @@ -148,7 +150,7 @@ "goodledoc": ".GoogledocGenerator", "sphinxdoc": ".SphinxdocGenerator", } - if docstringType in generatorModuleMapping: + with contextlib.suppress(KeyError): mod = importlib.import_module( generatorModuleMapping[docstringType], __package__ )