diff --git a/pupil_src/shared_modules/gaze_mapping/notifications.py b/pupil_src/shared_modules/gaze_mapping/notifications.py index a265fd332..504acfb7a 100644 --- a/pupil_src/shared_modules/gaze_mapping/notifications.py +++ b/pupil_src/shared_modules/gaze_mapping/notifications.py @@ -15,23 +15,7 @@ from typing_extensions import Self, TypedDict -if sys.version_info < (3, 9): - - def get_type_hints(cls): - return cls.__annotations__ - -else: - # Starting in Python 3.10, __annotations__ does no longer contain the annotations - # of the parent class. `_SerializedNamedTupleMixin.sanitize_serialized_dict` - # depends on the earlier implementation. - # We do not use `inspect.get_annotations()` as a replacement for two reasons: - # 1. It also does not include the base classes' annoations - # 2. The annotations might not be evaluated yet, containing `typing.ForwardRef` - # instances - # - # `typing.get_type_hints` implements the desired behavior but is only available in - # Python 3.9 or newer - from typing import get_type_hints +from typing import get_type_hints # TODO: Consider extending this pattern for notifications through the entire codebase and/or replace with dataclasses with Python 3.7 diff --git a/pupil_src/shared_modules/video_capture/neon_backend/background.py b/pupil_src/shared_modules/video_capture/neon_backend/background.py index a3299c14e..69c0fffd7 100644 --- a/pupil_src/shared_modules/video_capture/neon_backend/background.py +++ b/pupil_src/shared_modules/video_capture/neon_backend/background.py @@ -75,15 +75,12 @@ def _event_loop( ipc_push_url: str, topic_prefix: str = "shared_camera.", ): - with ( - NetworkInterface( - topic_prefix=topic_prefix, - ipc_pub_url=ipc_pub_url, - ipc_sub_url=ipc_sub_url, - ipc_push_url=ipc_push_url, - ) as network, - contextlib.suppress(KeyboardInterrupt), - ): + with NetworkInterface( + topic_prefix=topic_prefix, + ipc_pub_url=ipc_pub_url, + ipc_sub_url=ipc_sub_url, + ipc_push_url=ipc_push_url, + ) as network, contextlib.suppress(KeyboardInterrupt): process_started_event.set() camera_model = cm.Camera_Model.from_file(