From 68aac1511e5f3d740279de177f4948798647fe7a 2023-12-27 16:19:24 From: Matthias Bussonnier Date: 2023-12-27 16:19:24 Subject: [PATCH] Misc linnter cleanups --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 1a73571..fef5ddc 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -3604,7 +3604,7 @@ class InteractiveShell(SingletonConfigurable): # Things related to GUI support and pylab #------------------------------------------------------------------------- - active_eventloop = None + active_eventloop: Optional[str] = None def enable_gui(self, gui=None): raise NotImplementedError('Implement enable_gui in a subclass') diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index 532287f..1037634 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -1,6 +1,5 @@ """IPython terminal interface using prompt_toolkit""" -import asyncio import os import sys from warnings import warn @@ -96,7 +95,8 @@ def get_default_editor(): if os.name == 'posix': return 'vi' # the only one guaranteed to be there! else: - return 'notepad' # same in Windows! + return "notepad" # same in Windows! + # conservatively check for tty # overridden streams can result in things like: @@ -293,7 +293,6 @@ class TerminalInteractiveShell(InteractiveShell): return self.editing_mode - @observe('editing_mode') def _editing_mode(self, change): if self.pt_app: @@ -322,7 +321,6 @@ class TerminalInteractiveShell(InteractiveShell): def refresh_style(self): self._style = self._make_style_from_name_or_cls(self.highlighting_style) - highlighting_style_overrides = Dict( help="Override highlighting format for specific tokens" ).tag(config=True) @@ -859,7 +857,6 @@ class TerminalInteractiveShell(InteractiveShell): for cmd in ('clear', 'more', 'less', 'man'): self.alias_manager.soft_define_alias(cmd, cmd) - def __init__(self, *args, **kwargs) -> None: super(TerminalInteractiveShell, self).__init__(*args, **kwargs) self._set_autosuggestions(self.autosuggestions_provider) @@ -868,7 +865,6 @@ class TerminalInteractiveShell(InteractiveShell): self.keep_running = True self._set_formatter(self.autoformatter) - def ask_exit(self): self.keep_running = False @@ -916,7 +912,6 @@ class TerminalInteractiveShell(InteractiveShell): self._atexit_once() - _inputhook = None def inputhook(self, context): if self._inputhook is not None: