Skip to content

Commit 71217b3

Browse files
committed
Add type to supported_features
1 parent 1cf373b commit 71217b3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ipykernel/kernelbase.py

+7-7
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+
883885
info = {
884886
"protocol_version": kernel_protocol_version,
885887
"implementation": self.implementation,
886888
"implementation_version": self.implementation_version,
887889
"language_info": self.language_info,
888890
"banner": self.banner,
889891
"help_links": self.help_links,
890-
"supported_features": [],
891892
}
893+
supported_features: list[str] = []
892894
if self._supports_kernel_subshells:
893-
info["supported_features"] = ["kernel subshells"]
894-
895-
from .debugger import _is_debugpy_available
896-
895+
supported_features.append("kernel subshells")
897896
if _is_debugpy_available:
898-
info["supported_features"].append("debugger")
899-
897+
supported_features.append("debugger")
898+
if len(supported_features) > 0:
899+
info["supported_features"] = supported_features
900900
return info
901901

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

0 commit comments

Comments
 (0)