# Buggy code
def resolve_name(
    self, modname: str, parents: Any, path: str, base: Any
) -> Tuple[str, List[str]]:
    if modname is None:
        if path:
            mod_cls = path.rstrip(".")
        else:
            mod_cls = None
            # if documenting a class-level object without path,
            # there must be a current class, either from a parent
            # auto directive ...
            mod_cls = self.env.temp_data.get("autodoc:class")
            # ... or from a class directive
            if mod_cls is None:
                mod_cls = self.env.ref_context.get("py:class")
            # ... if still None, there's no way to know
            if mod_cls is None:
                return None, []

        try:
            modname, qualname = split_full_qualified_name(mod_cls)
            parents = qualname.split(".")
        except ImportError:
            parents = mod_cls.split(".")

        # if the module name is still missing, get it like above
        if not modname:
            modname = self.env.temp_data.get("autodoc:module")
        if not modname:
            modname = self.env.ref_context.get("py:module")
        # ... else, it stays None, which means invalid
    return modname, parents + [base]


# Traceback (TypeError)
WARNING: error while formatting arguments for errno.EINTR:
Traceback (most recent call last):
File "/Users/tkomiya/work/sphinx/sphinx/ext/autodoc/__init__.py", line 1049, in format_args
sig = inspect.signature(unwrapped)
File "/Users/tkomiya/work/sphinx/sphinx/util/inspect.py", line 406, in signature
signature = inspect.signature(subject)
File "/Users/tkomiya/.pyenv/versions/3.8.2/lib/python3.8/inspect.py", line 3093, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
File "/Users/tkomiya/.pyenv/versions/3.8.2/lib/python3.8/inspect.py", line 2842, in from_callable
return _signature_from_callable(obj, sigcls=cls,
File "/Users/tkomiya/.pyenv/versions/3.8.2/lib/python3.8/inspect.py", line 2216, in _signature_from_callable
raise TypeError('{!r} is not a callable object'.format(obj))
TypeError: 4 is not a callable object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/tkomiya/work/sphinx/sphinx/ext/autodoc/__init__.py", line 395, in format_signature
args = self.format_args(**kwargs)
File "/Users/tkomiya/work/sphinx/sphinx/ext/autodoc/__init__.py", line 1052, in format_args
if (inspect.is_builtin_class_method(unwrapped, '__new__') and
File "/Users/tkomiya/work/sphinx/sphinx/util/inspect.py", line 392, in is_builtin_class_method
classes = [c for c in inspect.getmro(obj) if attr_name in c.__dict__]
File "/Users/tkomiya/.pyenv/versions/3.8.2/lib/python3.8/inspect.py", line 489, in getmro
return cls.__mro__
AttributeError: 'int' object has no attribute '__mro__'

# Fixed code
def resolve_name(
    self, modname: str, parents: Any, path: str, base: Any
) -> Tuple[str, List[str]]:
    if modname is None:
        if path:
            mod_cls = path.rstrip(".")
        else:
            mod_cls = None
            # if documenting a class-level object without path,
            # there must be a current class, either from a parent
            # auto directive ...
            mod_cls = self.env.temp_data.get("autodoc:class")
            # ... or from a class directive
            if mod_cls is None:
                mod_cls = self.env.ref_context.get("py:class")
            # ... if still None, there's no way to know
            if mod_cls is None:
                return None, []

        try:
            modname, qualname = split_full_qualified_name(mod_cls)
            parents = qualname.split(".") if qualname else []
        except ImportError:
            parents = mod_cls.split(".")

        # if the module name is still missing, get it like above
        if not modname:
            modname = self.env.temp_data.get("autodoc:module")
        if not modname:
            modname = self.env.ref_context.get("py:module")
        # ... else, it stays None, which means invalid
    return modname, parents + [base]