From 667f3cbe6879d6fbe63ce8cb7895e2db6e49bfb7 2022-10-29 11:04:02 From: Matthias Bussonnier Date: 2022-10-29 11:04:02 Subject: [PATCH] Run black on all files that would lead to 3 lines changes or less --- diff --git a/IPython/core/tests/nonascii.py b/IPython/core/tests/nonascii.py index 78801df..12738e3 100644 --- a/IPython/core/tests/nonascii.py +++ b/IPython/core/tests/nonascii.py @@ -1,4 +1,4 @@ # coding: iso-8859-5 # (Unlikely to be the default encoding for most testers.) # ������������������� <- Cyrillic characters -u = '����' +u = "����" diff --git a/IPython/lib/tests/test_imports.py b/IPython/lib/tests/test_imports.py index d2e1b87..515cd4a 100644 --- a/IPython/lib/tests/test_imports.py +++ b/IPython/lib/tests/test_imports.py @@ -1,11 +1,14 @@ # encoding: utf-8 from IPython.testing import decorators as dec + def test_import_backgroundjobs(): from IPython.lib import backgroundjobs + def test_import_deepreload(): from IPython.lib import deepreload + def test_import_demo(): from IPython.lib import demo diff --git a/IPython/terminal/pt_inputhooks/asyncio.py b/IPython/terminal/pt_inputhooks/asyncio.py index 2d8c128..d2499e1 100644 --- a/IPython/terminal/pt_inputhooks/asyncio.py +++ b/IPython/terminal/pt_inputhooks/asyncio.py @@ -31,8 +31,7 @@ from prompt_toolkit import __version__ as ptk_version from IPython.core.async_helpers import get_asyncio_loop -PTK3 = ptk_version.startswith('3.') - +PTK3 = ptk_version.startswith("3.") def inputhook(context): diff --git a/IPython/terminal/pt_inputhooks/gtk.py b/IPython/terminal/pt_inputhooks/gtk.py index 6e246ba..5c201b6 100644 --- a/IPython/terminal/pt_inputhooks/gtk.py +++ b/IPython/terminal/pt_inputhooks/gtk.py @@ -41,6 +41,7 @@ import gtk, gobject # Enable threading in GTK. (Otherwise, GTK will keep the GIL.) gtk.gdk.threads_init() + def inputhook(context): """ When the eventloop of prompt-toolkit is idle, call this inputhook. @@ -50,6 +51,7 @@ def inputhook(context): :param context: An `InputHookContext` instance. """ + def _main_quit(*a, **kw): gtk.main_quit() return False diff --git a/IPython/terminal/pt_inputhooks/gtk3.py b/IPython/terminal/pt_inputhooks/gtk3.py index ae82b4e..b073bd9 100644 --- a/IPython/terminal/pt_inputhooks/gtk3.py +++ b/IPython/terminal/pt_inputhooks/gtk3.py @@ -3,10 +3,12 @@ from gi.repository import Gtk, GLib + def _main_quit(*args, **kwargs): Gtk.main_quit() return False + def inputhook(context): GLib.io_add_watch(context.fileno(), GLib.PRIORITY_DEFAULT, GLib.IO_IN, _main_quit) Gtk.main() diff --git a/IPython/testing/plugin/simplevars.py b/IPython/testing/plugin/simplevars.py index cac0b75..82a5edb 100644 --- a/IPython/testing/plugin/simplevars.py +++ b/IPython/testing/plugin/simplevars.py @@ -1,2 +1,2 @@ x = 1 -print('x is:',x) +print("x is:", x) diff --git a/IPython/utils/_sysinfo.py b/IPython/utils/_sysinfo.py index a80b029..2e58242 100644 --- a/IPython/utils/_sysinfo.py +++ b/IPython/utils/_sysinfo.py @@ -1,2 +1,2 @@ # GENERATED BY setup.py -commit = u"" +commit = "" diff --git a/IPython/utils/tests/test_dir2.py b/IPython/utils/tests/test_dir2.py index d35b110..bf7f5e5 100644 --- a/IPython/utils/tests/test_dir2.py +++ b/IPython/utils/tests/test_dir2.py @@ -19,7 +19,6 @@ def test_base(): def test_SubClass(): - class SubClass(Base): y = 2 @@ -53,7 +52,7 @@ def test_misbehaving_object_without_trait_names(): class SillierWithDir(MisbehavingGetattr): def __dir__(self): - return ['some_method'] + return ["some_method"] for bad_klass in (MisbehavingGetattr, SillierWithDir): obj = bad_klass() diff --git a/setupbase.py b/setupbase.py index 5db235c..748b4dd 100644 --- a/setupbase.py +++ b/setupbase.py @@ -346,7 +346,7 @@ def git_prebuild(pkg_dir, build_cmd=build_py): out_file.writelines( [ "# GENERATED BY setup.py\n", - 'commit = u"%s"\n' % repo_commit, + 'commit = "%s"\n' % repo_commit, ] )