Skip to content

Commit 0d31b53

Browse files
committed
Add type to supported_features
1 parent 1cf373b commit 0d31b53

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ipykernel/kernelbase.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -880,23 +880,23 @@ async def connect_request(self, socket, ident, parent):
880880

881881
@property
882882
def kernel_info(self):
883+
from .debugger import _is_debugpy_available
884+
885+
supported_features: list[str] = []
886+
if self._supports_kernel_subshells:
887+
supported_features.append("kernel subshells")
888+
if _is_debugpy_available:
889+
supported_features.append("debugger")
890+
883891
info = {
884892
"protocol_version": kernel_protocol_version,
885893
"implementation": self.implementation,
886894
"implementation_version": self.implementation_version,
887895
"language_info": self.language_info,
888896
"banner": self.banner,
889897
"help_links": self.help_links,
890-
"supported_features": [],
898+
"supported_features": supported_features
891899
}
892-
if self._supports_kernel_subshells:
893-
info["supported_features"] = ["kernel subshells"]
894-
895-
from .debugger import _is_debugpy_available
896-
897-
if _is_debugpy_available:
898-
info["supported_features"].append("debugger")
899-
900900
return info
901901

902902
async def kernel_info_request(self, socket, ident, parent):

0 commit comments

Comments
 (0)