Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Nov 2, 2023
1 parent d7c8dc2 commit abed5f1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ipykernel/kernelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations

import asyncio
import concurrent.futures
Expand Down Expand Up @@ -80,7 +81,7 @@ class Kernel(SingletonConfigurable):
# attribute to override with a GUI
eventloop = Any(None)

processes: t.Dict[str, psutil.Process] = {}
processes: dict[str, psutil.Process] = {}

@observe("eventloop")
def _update_eventloop(self, change):
Expand Down Expand Up @@ -153,10 +154,10 @@ def _default_ident(self):

# This should be overridden by wrapper kernels that implement any real
# language.
language_info: t.Dict[str, object] = {}
language_info: dict[str, object] = {}

# any links that should go in the help menu
help_links: List[t.Dict[str, str]] = List()
help_links: List[dict[str, str]] = List()

# Experimental option to break in non-user code.
# The ipykernel source is in the call stack, so the user
Expand Down Expand Up @@ -291,7 +292,7 @@ async def poll_control_queue(self):

async def _flush_control_queue(self):
"""Flush the control queue, wait for processing of any pending messages"""
tracer_future: t.Union[concurrent.futures.Future[object], asyncio.Future[object]]
tracer_future: concurrent.futures.Future[object] | asyncio.Future[object]
if self.control_thread:
control_loop = self.control_thread.io_loop
# concurrent.futures.Futures are threadsafe
Expand Down Expand Up @@ -945,7 +946,7 @@ async def interrupt_request(self, stream, ident, parent):
"""Handle an interrupt request."""
if not self.session:
return
content: t.Dict[str, t.Any] = {"status": "ok"}
content: dict[str, t.Any] = {"status": "ok"}
try:
self._send_interrupt_children()
except OSError as err:
Expand Down

0 comments on commit abed5f1

Please sign in to comment.