diff --git a/CHANGES b/CHANGES index 95df7062794..3e3a1c58882 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,7 @@ Release 7.2.3 (in development) Bugs fixed ---------- +* Fix regression in ``autodoc.Documenter.parse_name()``. Release 7.2.2 (released Aug 17, 2023) ===================================== diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index d523a2bdb19..c042aa71a7f 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -383,14 +383,12 @@ def parse_name(self) -> bool: # first, parse the definition -- auto directives for classes and # functions can contain a signature which is then used instead of # an autogenerated one - try: - matched = py_ext_sig_re.match(self.name) - assert matched is not None - explicit_modname, path, base, tp_list, args, retann = matched.groups() - except AttributeError: + matched = py_ext_sig_re.match(self.name) + if matched is None: logger.warning(__('invalid signature for auto%s (%r)') % (self.objtype, self.name), type='autodoc') return False + explicit_modname, path, base, tp_list, args, retann = matched.groups() # support explicit module and class name separation via :: if explicit_modname is not None: