diff --git a/Lib/pty.py b/Lib/pty.py index 4b25ac32c8da14..f65ff77f7234ba 100644 --- a/Lib/pty.py +++ b/Lib/pty.py @@ -37,7 +37,7 @@ def openpty(): try: from fcntl import ioctl, I_PUSH except ImportError: - return master_fd, slave_fd + return master_fd, slave_fd try: ioctl(slave_fd, I_PUSH, "ptem") ioctl(slave_fd, I_PUSH, "ldterm") diff --git a/Lib/test/test_ast/test_ast.py b/Lib/test/test_ast/test_ast.py index 01d2e392302e86..0af9229b26ce7c 100644 --- a/Lib/test/test_ast/test_ast.py +++ b/Lib/test/test_ast/test_ast.py @@ -3115,7 +3115,7 @@ def assert_ast(self, code, non_optimized_target, optimized_target): ) def create_binop(self, operand, left=ast.Constant(1), right=ast.Constant(1)): - return ast.BinOp(left=left, op=self.binop[operand], right=right) + return ast.BinOp(left=left, op=self.binop[operand], right=right) def test_folding_binop(self): code = "1 %s 1" diff --git a/Lib/test/test_asyncio/test_eager_task_factory.py b/Lib/test/test_asyncio/test_eager_task_factory.py index 31d2a00dbb8c9c..655e45ff288cc1 100644 --- a/Lib/test/test_asyncio/test_eager_task_factory.py +++ b/Lib/test/test_asyncio/test_eager_task_factory.py @@ -288,15 +288,15 @@ class DummyLoop: self.assertFalse(err) def test_issue122332(self): - async def coro(): - pass + async def coro(): + pass - async def run(): - task = self.loop.create_task(coro()) - await task - self.assertIsNone(task.get_coro()) + async def run(): + task = self.loop.create_task(coro()) + await task + self.assertIsNone(task.get_coro()) - self.run_coro(run()) + self.run_coro(run()) class AsyncTaskCounter: diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 6f838da6018741..ca76822d56ab57 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -539,10 +539,10 @@ def test_compile_redundant_jumps_and_nops_after_moving_cold_blocks(self): # make all instruction locations the same to create redundancies for node in ast.walk(tree): if hasattr(node,"lineno"): - del node.lineno - del node.end_lineno - del node.col_offset - del node.end_col_offset + del node.lineno + del node.end_lineno + del node.col_offset + del node.end_col_offset compile(ast.fix_missing_locations(tree), "", "exec") @@ -564,10 +564,10 @@ def test_compile_redundant_jump_after_convert_pseudo_ops(self): # make all instruction locations the same to create redundancies for node in ast.walk(tree): if hasattr(node,"lineno"): - del node.lineno - del node.end_lineno - del node.col_offset - del node.end_col_offset + del node.lineno + del node.end_lineno + del node.col_offset + del node.end_col_offset compile(ast.fix_missing_locations(tree), "", "exec") diff --git a/Lib/test/test_ctypes/test_bitfields.py b/Lib/test/test_ctypes/test_bitfields.py index 19ba2f4484e7da..d8b12d4509202b 100644 --- a/Lib/test/test_ctypes/test_bitfields.py +++ b/Lib/test/test_ctypes/test_bitfields.py @@ -153,7 +153,7 @@ def test_signed(self): for c_typ in signed_int_types: with self.subTest(c_typ): if sizeof(c_typ) != alignment(c_typ): - self.skipTest('assumes size=alignment') + self.skipTest('assumes size=alignment') class X(Structure): _fields_ = [("dummy", c_typ), ("a", c_typ, 3), @@ -173,7 +173,7 @@ def test_unsigned(self): for c_typ in unsigned_int_types: with self.subTest(c_typ): if sizeof(c_typ) != alignment(c_typ): - self.skipTest('assumes size=alignment') + self.skipTest('assumes size=alignment') class X(Structure): _fields_ = [("a", c_typ, 3), ("b", c_typ, 3), @@ -229,7 +229,7 @@ def test_single_bitfield_size(self): for c_typ in int_types: with self.subTest(c_typ): if sizeof(c_typ) != alignment(c_typ): - self.skipTest('assumes size=alignment') + self.skipTest('assumes size=alignment') result = self.fail_fields(("a", c_typ, -1)) self.assertEqual(result, (ValueError, "number of bits invalid for bit field 'a'")) diff --git a/Lib/test/test_ctypes/test_generated_structs.py b/Lib/test/test_ctypes/test_generated_structs.py index cbd73c4e911e4e..4c95e9eac6a947 100644 --- a/Lib/test/test_ctypes/test_generated_structs.py +++ b/Lib/test/test_ctypes/test_generated_structs.py @@ -533,7 +533,7 @@ def dump_ctype(tp, struct_or_union_tag='', variable_name='', semi=''): def struct_or_union(cls): if issubclass(cls, Structure): - return 'struct' + return 'struct' if issubclass(cls, Union): return 'union' raise TypeError(cls) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 2f1f9e86a0bce4..a0bc383f9875c0 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -7472,7 +7472,7 @@ def test_no_generator_instantiation(self): def test_async_generator(self): async def f(): - yield 42 + yield 42 g = f() self.assertIsSubclass(type(g), typing.AsyncGenerator)