diff --git a/ops/framework.py b/ops/framework.py index 7c96ee551..c47e6b9a0 100644 --- a/ops/framework.py +++ b/ops/framework.py @@ -485,7 +485,7 @@ def _event_kinds(self) -> List[str]: event_kinds.append(attr_name) return event_kinds - def events(self) -> Dict[str, EventSource]: + def events(self) -> Dict[str, BoundEvent]: """Return a mapping of event_kinds to bound_events for all available events.""" return {event_kind: getattr(self, event_kind) for event_kind in self._event_kinds()} diff --git a/ops/main.py b/ops/main.py index 94105cbc7..871a749aa 100644 --- a/ops/main.py +++ b/ops/main.py @@ -55,7 +55,7 @@ def _exe_path(path: Path) -> Optional[Path]: def _create_event_link( charm: 'ops.charm.CharmBase', - bound_event: 'ops.framework.EventSource', + bound_event: 'ops.framework.BoundEvent', link_to: Union[str, Path], ): """Create a symlink for a particular event. @@ -66,7 +66,7 @@ def _create_event_link( link_to: What the event link should point to """ # type guard - assert bound_event.event_kind, f'unbound EventSource {bound_event}' + assert bound_event.event_kind, f'unbound BoundEvent {bound_event}' if issubclass(bound_event.event_type, ops.charm.HookEvent): event_dir = charm.framework.charm_dir / 'hooks'