From 273ea6fe5f4c47658ea6f7e6d7a5bc8b6c2c0c4d 2024-07-03 10:12:07 From: krassowski <5832902+krassowski@users.noreply.github.com> Date: 2024-07-03 10:12:07 Subject: [PATCH] Fix exception on missing attribute matches --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 9dfa3e4..bac9e1d 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -1141,16 +1141,16 @@ class Completer(Configurable): """ return self._attr_matches(text)[0] - def _attr_matches(self, text, include_prefix=True): + def _attr_matches(self, text, include_prefix=True) -> Tuple[Sequence[str], str]: m2 = re.match(r"(.+)\.(\w*)$", self.line_buffer) if not m2: - return [] + return [], "" expr, attr = m2.group(1, 2) obj = self._evaluate_expr(expr) if obj is not_found: - return [] + return [], "" if self.limit_to__all__ and hasattr(obj, '__all__'): words = get__all__entries(obj)