Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ipykernel/zmqshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def edit(self, parameter_s="", last_call=None):

payload = {"source": "edit_magic", "filename": filename, "line_number": lineno}
assert self.shell is not None
self.shell.payload_manager.write_payload(payload) # type: ignore[unreachable]
self.shell.payload_manager.write_payload(payload) # type: ignore[union-attr]

# A few magics that are adapted to the specifics of using pexpect and a
# remote terminal
Expand All @@ -361,7 +361,7 @@ def edit(self, parameter_s="", last_call=None):
def clear(self, arg_s):
"""Clear the terminal."""
assert self.shell is not None
if os.name == "posix": # type: ignore[unreachable]
if os.name == "posix":
self.shell.system("clear")
else:
self.shell.system("cls")
Expand All @@ -383,7 +383,7 @@ def less(self, arg_s):

if arg_s.endswith(".py"):
assert self.shell is not None
cont = self.shell.pycolorize(openpy.read_py_file(arg_s, skip_encoding_cookie=False)) # type: ignore[unreachable]
cont = self.shell.pycolorize(openpy.read_py_file(arg_s, skip_encoding_cookie=False))
else:
with open(arg_s) as fid:
cont = fid.read()
Expand All @@ -398,7 +398,7 @@ def less(self, arg_s):
def man(self, arg_s):
"""Find the man page for the given command and display in pager."""
assert self.shell is not None
page.page(self.shell.getoutput("man %s | col -b" % arg_s, split=False)) # type: ignore[unreachable]
page.page(self.shell.getoutput("man %s | col -b" % arg_s, split=False))

@line_magic
def connect_info(self, arg_s):
Expand Down