From 6927632492cbad86a250aa006c1847e03b03e70b Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 5 Mar 2022 17:47:00 +0200 Subject: [PATCH] Remove trailing spaces (GH-31695) --- Lib/asyncio/sslproto.py | 4 ++-- Lib/asyncio/transports.py | 4 ++-- Lib/codeop.py | 2 +- Lib/concurrent/futures/_base.py | 2 +- Lib/importlib/_bootstrap_external.py | 2 +- Lib/test/test_asyncio/test_sendfile.py | 4 ++-- Lib/test/test_syntax.py | 4 ++-- Lib/test/test_tokenize.py | 10 +++++----- Lib/test/test_typing.py | 4 ++-- Modules/_blake2/blake2s_impl.c | 3 ++- Python/fileutils.c | 2 +- Python/specialize.c | 2 +- Tools/scripts/freeze_modules.py | 4 ++-- 13 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index de7c3332e4d..de00953cc1d 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -197,8 +197,8 @@ def get_read_buffer_size(self): return self._ssl_protocol._get_read_buffer_size() def get_write_buffer_limits(self): - """Get the high and low watermarks for write flow control. - Return a tuple (low, high) where low and high are + """Get the high and low watermarks for write flow control. + Return a tuple (low, high) where low and high are positive number of bytes.""" return self._ssl_protocol._transport.get_write_buffer_limits() diff --git a/Lib/asyncio/transports.py b/Lib/asyncio/transports.py index 73b1fa2de41..30fd41d49af 100644 --- a/Lib/asyncio/transports.py +++ b/Lib/asyncio/transports.py @@ -100,8 +100,8 @@ def get_write_buffer_size(self): raise NotImplementedError def get_write_buffer_limits(self): - """Get the high and low watermarks for write flow control. - Return a tuple (low, high) where low and high are + """Get the high and low watermarks for write flow control. + Return a tuple (low, high) where low and high are positive number of bytes.""" raise NotImplementedError diff --git a/Lib/codeop.py b/Lib/codeop.py index 568e9bbc118..45a378baba4 100644 --- a/Lib/codeop.py +++ b/Lib/codeop.py @@ -43,7 +43,7 @@ # The following flags match the values from Include/cpython/compile.h # Caveat emptor: These flags are undocumented on purpose and depending # on their effect outside the standard library is **unsupported**. -PyCF_DONT_IMPLY_DEDENT = 0x200 +PyCF_DONT_IMPLY_DEDENT = 0x200 PyCF_ALLOW_INCOMPLETE_INPUT = 0x4000 def _maybe_compile(compiler, source, filename, symbol): diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py index c5912c24a1c..706a4f2c09d 100644 --- a/Lib/concurrent/futures/_base.py +++ b/Lib/concurrent/futures/_base.py @@ -282,7 +282,7 @@ def wait(fs, timeout=None, return_when=ALL_COMPLETED): A named 2-tuple of sets. The first set, named 'done', contains the futures that completed (is finished or cancelled) before the wait completed. The second set, named 'not_done', contains uncompleted - futures. Duplicate futures given to *fs* are removed and will be + futures. Duplicate futures given to *fs* are removed and will be returned only once. """ fs = set(fs) diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 529ca5a2951..741247dd25d 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -390,7 +390,7 @@ def _write_atomic(path, data, mode=0o666): # Python 3.11a5 3481 (Use inline cache for BINARY_OP) # Python 3.11a5 3482 (Use inline caching for UNPACK_SEQUENCE and LOAD_GLOBAL) # Python 3.11a5 3483 (Use inline caching for COMPARE_OP and BINARY_SUBSCR) -# Python 3.11a5 3484 (Use inline caching for LOAD_ATTR, LOAD_METHOD, and +# Python 3.11a5 3484 (Use inline caching for LOAD_ATTR, LOAD_METHOD, and # STORE_ATTR) # Python 3.11a5 3485 (Add an oparg to GET_AWAITABLE) diff --git a/Lib/test/test_asyncio/test_sendfile.py b/Lib/test/test_asyncio/test_sendfile.py index effca6644c0..a10504b1c41 100644 --- a/Lib/test/test_asyncio/test_sendfile.py +++ b/Lib/test/test_asyncio/test_sendfile.py @@ -93,8 +93,8 @@ async def wait_closed(self): class SendfileBase: # 256 KiB plus small unaligned to buffer chunk - # Newer versions of Windows seems to have increased its internal - # buffer and tries to send as much of the data as it can as it + # Newer versions of Windows seems to have increased its internal + # buffer and tries to send as much of the data as it can as it # has some form of buffering for this which is less than 256KiB # on newer server versions and Windows 11. # So DATA should be larger than 256 KiB to make this test reliable. diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index 8ddfe91a6e1..5134dcbe652 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -1630,8 +1630,8 @@ def fib(n): self.assertEqual(compile(s1, '', 'exec'), compile(s2, '', 'exec')) except SyntaxError: self.fail("Indented statement over multiple lines is valid") - - def test_continuation_bad_indentation(self): + + def test_continuation_bad_indentation(self): # Check that code that breaks indentation across multiple lines raises a syntax error code = r"""\ diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index 334390abaa2..1272e1e9be0 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -2511,8 +2511,8 @@ def get_tokens(string): self.assertRaises(SyntaxError, get_tokens, "("*1000+"a"+")"*1000) self.assertRaises(SyntaxError, get_tokens, "]") - - def test_continuation_lines_indentation(self): + + def test_continuation_lines_indentation(self): def get_tokens(string): return [(kind, string) for (kind, string, *_) in _generate_tokens_from_c_tokenizer(string)] @@ -2551,7 +2551,7 @@ def fib(n): '''Print a Fibonacci series up to n.''' a, b = 0, 1 """) - + self.assertEqual(get_tokens(code), get_tokens(code_no_cont)) code = dedent(""" @@ -2572,7 +2572,7 @@ def fib(n): pass pass """) - + self.assertEqual(get_tokens(code), get_tokens(code_no_cont)) code = dedent(""" @@ -2609,7 +2609,7 @@ def fib(n): """) self.assertEqual(get_tokens(code), get_tokens(code_no_cont)) - + if __name__ == "__main__": unittest.main() diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index bd992043622..86baed98fca 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -2930,8 +2930,8 @@ def fun(x: a): def test_forward_repr(self): self.assertEqual(repr(List['int']), "typing.List[ForwardRef('int')]") - self.assertEqual(repr(List[ForwardRef('int', module='mod')]), - "typing.List[ForwardRef('int', module='mod')]") + self.assertEqual(repr(List[ForwardRef('int', module='mod')]), + "typing.List[ForwardRef('int', module='mod')]") def test_union_forward(self): diff --git a/Modules/_blake2/blake2s_impl.c b/Modules/_blake2/blake2s_impl.c index 763c0178e6b..4812730bd8e 100644 --- a/Modules/_blake2/blake2s_impl.c +++ b/Modules/_blake2/blake2s_impl.c @@ -18,7 +18,7 @@ #endif #include "Python.h" -#include "pycore_strhex.h" // _Py_strhex() +#include "pycore_strhex.h" // _Py_strhex() #include "../hashlib.h" #include "blake2ns.h" @@ -37,6 +37,7 @@ #include "impl/blake2s-ref.c" #endif + extern PyType_Spec blake2s_type_spec; typedef struct { diff --git a/Python/fileutils.c b/Python/fileutils.c index 9a71b83f455..111d7fa84b1 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -2093,7 +2093,7 @@ join_relfile(wchar_t *buffer, size_t bufsize, const wchar_t *dirname, const wchar_t *relfile) { #ifdef MS_WINDOWS - if (FAILED(PathCchCombineEx(buffer, bufsize, dirname, relfile, + if (FAILED(PathCchCombineEx(buffer, bufsize, dirname, relfile, PATHCCH_ALLOW_LONG_PATHS))) { return -1; } diff --git a/Python/specialize.c b/Python/specialize.c index 6328f11f904..417eece88b8 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -1077,7 +1077,7 @@ _Py_Specialize_LoadMethod(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name) PyTypeObject *owner_cls = Py_TYPE(owner); if (PyModule_CheckExact(owner)) { - assert(INLINE_CACHE_ENTRIES_LOAD_ATTR <= + assert(INLINE_CACHE_ENTRIES_LOAD_ATTR <= INLINE_CACHE_ENTRIES_LOAD_METHOD); int err = specialize_module_load_attr(owner, instr, name, LOAD_METHOD, LOAD_METHOD_MODULE); diff --git a/Tools/scripts/freeze_modules.py b/Tools/scripts/freeze_modules.py index 0dc61e2fe32..c8d8a7dd1fb 100644 --- a/Tools/scripts/freeze_modules.py +++ b/Tools/scripts/freeze_modules.py @@ -18,7 +18,7 @@ FROZEN_ONLY = os.path.join(ROOT_DIR, 'Tools', 'freeze', 'flag.py') STDLIB_DIR = os.path.join(ROOT_DIR, 'Lib') -# If FROZEN_MODULES_DIR or DEEPFROZEN_MODULES_DIR is changed then the +# If FROZEN_MODULES_DIR or DEEPFROZEN_MODULES_DIR is changed then the # .gitattributes and .gitignore files needs to be updated. FROZEN_MODULES_DIR = os.path.join(ROOT_DIR, 'Python', 'frozen_modules') DEEPFROZEN_MODULES_DIR = os.path.join(ROOT_DIR, 'Python', 'deepfreeze') @@ -732,4 +732,4 @@ def main(): if __name__ == '__main__': - main() + main()