From f3215d2d9d6789b59002527f833f1fb427093056 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 24 Jun 2022 17:53:09 +0200 Subject: [PATCH 1/3] Run Tools/scripts/reindent.py Reindent files which were not properly formatted (PEP 8: 4 spaces). Remove also some trailing spaces. Leave Lib/test/coding20731.py and Tools/c-analyzer/ unchanged. --- Lib/http/client.py | 2 +- Lib/idlelib/iomenu.py | 2 +- Lib/test/libregrtest/setup.py | 1 - Lib/test/test_ast.py | 4 ++-- Lib/test/test_enum.py | 2 +- Lib/test/test_except_star.py | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Lib/http/client.py b/Lib/http/client.py index 4bef50e6474d49..0720990f84e7ed 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -956,7 +956,7 @@ def connect(self): (self.host,self.port), self.timeout, self.source_address) # Might fail in OSs that don't implement TCP_NODELAY try: - self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) + self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) except OSError as e: if e.errno != errno.ENOPROTOOPT: raise diff --git a/Lib/idlelib/iomenu.py b/Lib/idlelib/iomenu.py index 86ce68c06a4470..1ad5f42ec84206 100644 --- a/Lib/idlelib/iomenu.py +++ b/Lib/idlelib/iomenu.py @@ -20,7 +20,7 @@ else: errors = 'surrogateescape' - + class IOBinding: # One instance per editor Window so methods know which to save, close. # Open returns focus to self.editwin if aborted. diff --git a/Lib/test/libregrtest/setup.py b/Lib/test/libregrtest/setup.py index 4298c922723407..b76bece7ca08b5 100644 --- a/Lib/test/libregrtest/setup.py +++ b/Lib/test/libregrtest/setup.py @@ -157,4 +157,3 @@ def _adjust_resource_limits(): except (ValueError, OSError) as err: print(f"Unable to raise RLIMIT_NOFILE from {fd_limit} to " f"{new_fd_limit}: {err}.") - diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 33df22cb35a9e2..225892414b8c19 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -335,7 +335,7 @@ def test_ast_validation(self): for snippet in snippets_to_validate: tree = ast.parse(snippet) compile(tree, '', 'exec') - + def test_invalid_position_information(self): invalid_linenos = [ (10, 1), (-10, -11), (10, -11), (-5, -2), (-5, 1) @@ -364,7 +364,7 @@ def test_invalid_position_information(self): def test_compilation_of_ast_nodes_with_default_end_position_values(self): tree = ast.Module(body=[ - ast.Import(names=[ast.alias(name='builtins', lineno=1, col_offset=0)], lineno=1, col_offset=0), + ast.Import(names=[ast.alias(name='builtins', lineno=1, col_offset=0)], lineno=1, col_offset=0), ast.Import(names=[ast.alias(name='traceback', lineno=0, col_offset=0)], lineno=0, col_offset=1) ], type_ignores=[]) diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index 1968c8abd50dcf..cd7939a41d07cd 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -4081,7 +4081,7 @@ class Color(enum.Enum) |\x20\x20 | __contains__(value) from enum.EnumType | Return True if `value` is in `cls`. - | + | | `value` is in `cls` if: | 1) `value` is a member of `cls`, or | 2) `value` is the value of one of the `cls`'s members. diff --git a/Lib/test/test_except_star.py b/Lib/test/test_except_star.py index 490b159e3b71b2..dbe8eff32924ed 100644 --- a/Lib/test/test_except_star.py +++ b/Lib/test/test_except_star.py @@ -955,7 +955,7 @@ def derive(self, excs): def test_falsy_exception_group_subclass(self): class FalsyEG(ExceptionGroup): def __bool__(self): - return False + return False def derive(self, excs): return FalsyEG(self.message, excs) From 229b290de49020e90723c706db4386de8c4ae439 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Fri, 24 Jun 2022 12:10:20 -0400 Subject: [PATCH 2/3] Revert iomenu.py --- Lib/idlelib/iomenu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/idlelib/iomenu.py b/Lib/idlelib/iomenu.py index 1ad5f42ec84206..86ce68c06a4470 100644 --- a/Lib/idlelib/iomenu.py +++ b/Lib/idlelib/iomenu.py @@ -20,7 +20,7 @@ else: errors = 'surrogateescape' - + class IOBinding: # One instance per editor Window so methods know which to save, close. # Open returns focus to self.editwin if aborted. From fab2d1ff118c6b1b4f947f5fd86a6ed2af5c258f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 24 Jun 2022 18:37:58 +0200 Subject: [PATCH 3/3] Revert test_enum change --- Lib/test/test_enum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index cd7939a41d07cd..1968c8abd50dcf 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -4081,7 +4081,7 @@ class Color(enum.Enum) |\x20\x20 | __contains__(value) from enum.EnumType | Return True if `value` is in `cls`. - | + | | `value` is in `cls` if: | 1) `value` is a member of `cls`, or | 2) `value` is the value of one of the `cls`'s members.