# Buggy code
def __init__(self) -> None:
    self.registry = SphinxComponentRegistry()
    self.messagelog = []  # type: List[str]
    self.verbosity = 0


# Traceback (AttributeError)
Traceback (most recent call last):
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/site-packages/sphinx/ext/autosummary/generate.py", line 142, in skip_member
return app.emit_firstresult('autodoc-skip-member', objtype, name,
AttributeError: 'DummyApplication' object has no attribute 'emit_firstresult'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/rmay/miniconda3/envs/py38/bin/sphinx-autogen", line 10, in <module>
sys.exit(main())
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/site-packages/sphinx/ext/autosummary/generate.py", line 465, in main
generate_autosummary_docs(args.source_file, args.output_dir,
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/site-packages/sphinx/ext/autosummary/generate.py", line 280, in generate_autosummary_docs
rendered = generate_autosummary_content(name, obj, parent,
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/site-packages/sphinx/ext/autosummary/generate.py", line 182, in generate_autosummary_content
get_members(obj, {'function'}, imported=imported_members)
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/site-packages/sphinx/ext/autosummary/generate.py", line 163, in get_members
skipped = skip_member(value, name, documenter.objtype)
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/site-packages/sphinx/ext/autosummary/generate.py", line 145, in skip_member
logger.warning(__('autosummary: failed to determine %r to be documented.'
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/logging/__init__.py", line 1797, in warning
self.log(WARNING, msg, *args, **kwargs)
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/site-packages/sphinx/util/logging.py", line 124, in log
super().log(level, msg, *args, **kwargs)
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/logging/__init__.py", line 1829, in log
self.logger.log(level, msg, *args, **kwargs)
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/logging/__init__.py", line 1500, in log
self._log(level, msg, args, **kwargs)
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/logging/__init__.py", line 1577, in _log
self.handle(record)
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/logging/__init__.py", line 1587, in handle
self.callHandlers(record)
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/logging/__init__.py", line 1649, in callHandlers
hdlr.handle(record)
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/logging/__init__.py", line 946, in handle
rv = self.filter(record)
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/logging/__init__.py", line 807, in filter
result = f.filter(record)
File "/Users/rmay/miniconda3/envs/py38/lib/python3.8/site-packages/sphinx/util/logging.py", line 381, in filter
self.app._warncount += 1
AttributeError: 'DummyApplication' object has no attribute '_warncount'

# Fixed code
def __init__(self) -> None:
    self.registry = SphinxComponentRegistry()
    self.messagelog = []  # type: List[str]
    self.verbosity = 0
    self._warncount = 0
    self.warningiserror = False