bpo-31462: Remove trailing whitespaces. (#3564)

diff --git a/Include/pyatomic.h b/Include/pyatomic.h
index bd516b8..9a497a6 100644
--- a/Include/pyatomic.h
+++ b/Include/pyatomic.h
@@ -11,7 +11,7 @@
 #endif
 
 
-#if defined(_MSC_VER) 
+#if defined(_MSC_VER)
 #include <intrin.h>
 #include <immintrin.h>
 #endif
@@ -223,7 +223,7 @@
         result; \
     })
 
-#elif defined(_MSC_VER) 
+#elif defined(_MSC_VER)
 /*  _Interlocked* functions provide a full memory barrier and are therefore
     enough for acq_rel and seq_cst. If the HLE variants aren't available
     in hardware they will fall back to a full memory barrier as well.
@@ -249,7 +249,7 @@
 } _Py_atomic_int;
 
 
-#if defined(_M_X64) 
+#if defined(_M_X64)
 #define _Py_atomic_store_64bit(ATOMIC_VAL, NEW_VAL, ORDER) \
     switch (ORDER) { \
     case _Py_memory_order_acquire: \
@@ -312,7 +312,7 @@
       break;
     }
     }
-    return old; 
+    return old;
 }
 
 #else
@@ -347,7 +347,7 @@
       break;
     }
     }
-    return old; 
+    return old;
 }
 
 #define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \
@@ -379,7 +379,7 @@
 } _Py_atomic_int;
 
 
-#if defined(_M_ARM64) 
+#if defined(_M_ARM64)
 #define _Py_atomic_store_64bit(ATOMIC_VAL, NEW_VAL, ORDER) \
     switch (ORDER) { \
     case _Py_memory_order_acquire: \
@@ -442,7 +442,7 @@
       break;
     }
     }
-    return old; 
+    return old;
 }
 
 #else
@@ -477,13 +477,13 @@
       break;
     }
     }
-    return old; 
+    return old;
 }
 
 #define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \
   if (sizeof(*ATOMIC_VAL._value) == 8) { \
     _Py_atomic_store_64bit(ATOMIC_VAL._value, NEW_VAL, ORDER) } else { \
-    _Py_atomic_store_32bit(ATOMIC_VAL._value, NEW_VAL, ORDER) } 
+    _Py_atomic_store_32bit(ATOMIC_VAL._value, NEW_VAL, ORDER) }
 
 #define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \
   ( \
diff --git a/Lib/http/server.py b/Lib/http/server.py
index b1151a2..502bce0 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -717,7 +717,7 @@
                             fs.st_mtime, datetime.timezone.utc)
                         # remove microseconds, like in If-Modified-Since
                         last_modif = last_modif.replace(microsecond=0)
-                        
+
                         if last_modif <= ims:
                             self.send_response(HTTPStatus.NOT_MODIFIED)
                             self.end_headers()
@@ -727,7 +727,7 @@
             self.send_response(HTTPStatus.OK)
             self.send_header("Content-type", ctype)
             self.send_header("Content-Length", str(fs[6]))
-            self.send_header("Last-Modified", 
+            self.send_header("Last-Modified",
                 self.date_time_string(fs.st_mtime))
             self.end_headers()
             return f
diff --git a/Lib/idlelib/ChangeLog b/Lib/idlelib/ChangeLog
index 0c36664..d7d7e1e 100644
--- a/Lib/idlelib/ChangeLog
+++ b/Lib/idlelib/ChangeLog
@@ -27,9 +27,9 @@
 
 	* INSTALLATION, setup.py: INSTALLATION: Remove the coexist.patch
 	instructions
-	
+
 	**************** setup.py:
-	
+
 	Remove the idles script, add some words on IDLE Fork to the
 	long_description, and clean up some line spacing.
 
@@ -42,30 +42,30 @@
 	* PyShell.py, idle, idles: Implement idle command interface as
 	suggested by GvR [idle-dev] 16 July **************** PyShell: Added
 	functionality:
-	
+
 	usage: idle.py [-c command] [-d] [-i] [-r script] [-s] [-t title]
 	[arg] ...
-	
+
 	idle file(s)	(without options) edit the file(s)
-	
+
 	-c cmd	   run the command in a shell -d	 enable the
 	debugger -i	    open an interactive shell -i file(s) open a
 	shell and also an editor window for each file -r script  run a file
 	as a script in a shell -s	  run $IDLESTARTUP or
 	$PYTHONSTARTUP before anything else -t title   set title of shell
 	window
-	
+
 	Remaining arguments are applied to the command (-c) or script (-r).
-	
+
 	****************** idles: Removed the idles script, not needed
-	
+
 	****************** idle:  Removed the IdleConf references, not
 	required anymore
 
 2001-07-16 17:08  kbk
 
 	* INSTALLATION, coexist.patch: Added installation instructions.
-	
+
 	Added a patch which modifies idlefork so that it can co-exist with
 	"official" IDLE in the site-packages directory. This patch is not
 	necessary if only idlefork IDLE is installed. See INSTALLATION for
@@ -74,7 +74,7 @@
 2001-07-16 15:50  kbk
 
 	* idles: Add a script "idles" which opens a Python Shell window.
-	
+
 	The default behaviour of idlefork idle is to open an editor window
 	instead of a shell. Complex expressions may be run in a fresh
 	environment by selecting "run".  There are times, however, when a
@@ -90,7 +90,7 @@
 
 	* PyShell.py, setup.py: Add a script "idles" which opens a Python
 	Shell window.
-	
+
 	The default behaviour of idlefork idle is to open an editor window
 	instead of a shell. Complex expressions may be run in a fresh
 	environment by selecting "run".  There are times, however, when a
@@ -110,13 +110,13 @@
 
 	* setup.py: Installing Idle to site-packages via Distutils does not
 	copy the Idle help.txt file.
-	
+
 	Ref SF Python Patch 422471
 
 2001-07-14 15:26  kbk
 
 	* keydefs.py: py-cvs-2001_07_13 (Rev 1.3) merge
-	
+
 	"Make copy, cut and paste events case insensitive.  Reported by
 	Patrick K. O'Brien on idle-dev. (Should other bindings follow
 	suit?)" --GvR
@@ -124,7 +124,7 @@
 2001-07-14 15:21  kbk
 
 	* idle.py: py-cvs-2001_07_13 (Rev 1.4) merge
-	
+
 	"Move the action of loading the configuration to the IdleConf
 	module rather than the idle.py script.	This has advantages and
 	disadvantages; the biggest advantage being that we can more easily
@@ -133,21 +133,21 @@
 2001-07-14 15:18  kbk
 
 	* extend.txt: py-cvs-2001_07_13 (Rev 1.4) merge
-	
+
 	"Quick update to the extension mechanism (extend.py is gone, long
 	live config.txt)" --GvR
 
 2001-07-14 15:15  kbk
 
 	* StackViewer.py: py-cvs-2001_07_13 (Rev 1.16) merge
-	
+
 	"Refactored, with some future plans in mind. This now uses the new
 	gotofileline() method defined in FileList.py"  --GvR
 
 2001-07-14 15:10  kbk
 
 	* PyShell.py: py-cvs-2001_07_13 (Rev 1.34) merge
-	
+
 	"Amazing.  A very subtle change in policy in descr-branch actually
 	found a bug here.  Here's the deal: Class PyShell derives from
 	class OutputWindow.  Method PyShell.close() wants to invoke its
@@ -166,19 +166,19 @@
 2001-07-14 14:59  kbk
 
 	* PyParse.py: py-cvs-2001_07_13 (Rel 1.9) merge
-	
+
 	"Taught IDLE's autoident parser that "yield" is a keyword that
 	begins a stmt.	Along w/ the preceding change to keyword.py, making
 	all this work w/ a future-stmt just looks harder and harder."
 	--tim_one
-	
+
 	(From Rel 1.8: "Hack to make this still work with Python 1.5.2.
 	;-( " --fdrake)
 
 2001-07-14 14:51  kbk
 
 	* IdleConf.py: py-cvs-2001_07_13 (Rel 1.7) merge
-	
+
 	"Move the action of loading the configuration to the IdleConf
 	module rather than the idle.py script.	This has advantages and
 	disadvantages; the biggest advantage being that we can more easily
@@ -187,11 +187,11 @@
 2001-07-14 14:45  kbk
 
 	* FileList.py: py-cvs-2000_07_13 (Rev 1.9) merge
-	
+
 	"Delete goodname() method, which is unused. Add gotofileline(), a
 	convenience method which I intend to use in a variant. Rename
 	test() to _test()."  --GvR
-	
+
 	This was an interesting merge. The join completely missed removing
 	goodname(), which was adjacent, but outside of, a small conflict.
 	I only caught it by comparing the 1.1.3.2/1.1.3.3 diff.  CVS ain't
@@ -245,13 +245,13 @@
 2001-07-14 10:13  kbk
 
 	* PyShell.py: cvs-py-rel2_1 (Rev 1.29 - 1.33) merge
-	
+
 	Merged the following py-cvs revs without conflict: 1.29 Reduce
 	copyright text output at startup 1.30 Delay setting sys.args until
 	Tkinter is fully initialized 1.31 Whitespace normalization 1.32
 	Turn syntax warning into error when interactive 1.33 Fix warning
 	initialization bug
-	
+
 	Note that module is extensively modified wrt py-cvs
 
 2001-07-14 06:33  kbk
@@ -317,14 +317,14 @@
 2001-07-13 13:35  kbk
 
 	* EditorWindow.py: py-cvs-rel2_1 (Rev 1.33 - 1.37) merge
-	
+
 	VP IDLE version depended on VP's ExecBinding.py and spawn.py to get
 	the path to the Windows Doc directory (relative to python.exe).
 	Removed this conflicting code in favor of py-cvs updates which on
 	Windows use a hard coded path relative to the location of this
 	module. py-cvs updates include support for webbrowser.py.  Module
 	still has BrowserControl.py for 1.5.2 support.
-	
+
 	At this point, the differences wrt py-cvs relate to menu
 	functionality.
 
@@ -1194,7 +1194,7 @@
 ======================================================================
 	Python release 1.5.2b2, IDLE version 0.3
 ======================================================================
-	
+
 Wed Feb 17 22:47:41 1999  Guido van Rossum  <guido@cnri.reston.va.us>
 
 	* NEWS.txt: News in 0.3.
@@ -1330,7 +1330,7 @@
 ======================================================================
 	Python release 1.5.2b1, IDLE version 0.2
 ======================================================================
-	
+
 Fri Jan  8 17:26:02 1999  Guido van Rossum  <guido@cnri.reston.va.us>
 
 	* README.txt, NEWS.txt: What's new in this release.
diff --git a/Lib/idlelib/README.txt b/Lib/idlelib/README.txt
index 51e8ef5..c784a1a 100644
--- a/Lib/idlelib/README.txt
+++ b/Lib/idlelib/README.txt
@@ -206,7 +206,7 @@
   <open windows>   # windows
 
 Help
-  About IDLE       # eEW.about_dialog, help_about.AboutDialog 
+  About IDLE       # eEW.about_dialog, help_about.AboutDialog
   ---
   IDLE Help        # eEW.help_dialog, helpshow_idlehelp
   Python Doc       # eEW.python_docs
@@ -230,7 +230,7 @@
 <No menu>
 Center Insert      # eEW.center_insert_event
 
-  
+
 CODE STYLE -- Generally PEP 8.
 
 import
diff --git a/Lib/idlelib/idle_test/README.txt b/Lib/idlelib/idle_test/README.txt
index a54e74d..c580fb9 100644
--- a/Lib/idlelib/idle_test/README.txt
+++ b/Lib/idlelib/idle_test/README.txt
@@ -164,7 +164,7 @@
 5. Test Coverage
 
 Install the coverage package into your Python 3.6 site-packages
-directory.  (Its exact location depends on the OS). 
+directory.  (Its exact location depends on the OS).
 > python3 -m pip install coverage
 (On Windows, replace 'python3 with 'py -3.6' or perhaps just 'python'.)
 
diff --git a/Lib/test/dtracedata/call_stack.d b/Lib/test/dtracedata/call_stack.d
index 450e939..761d30f 100644
--- a/Lib/test/dtracedata/call_stack.d
+++ b/Lib/test/dtracedata/call_stack.d
@@ -10,7 +10,7 @@
 /self->trace/
 {
     printf("%d\t%*s:", timestamp, 15, probename);
-    printf("%*s", self->indent, ""); 
+    printf("%*s", self->indent, "");
     printf("%s:%s:%d\n", basename(copyinstr(arg0)), copyinstr(arg1), arg2);
     self->indent++;
 }
@@ -20,7 +20,7 @@
 {
     self->indent--;
     printf("%d\t%*s:", timestamp, 15, probename);
-    printf("%*s", self->indent, ""); 
+    printf("%*s", self->indent, "");
     printf("%s:%s:%d\n", basename(copyinstr(arg0)), copyinstr(arg1), arg2);
 }
 
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 350d5db..7cc1e78 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -2018,7 +2018,7 @@
                          ((('args', ..., ..., 'var_positional'),), ...))
         self.assertEqual(self.signature(A.f3),
                          ((('args', ..., ..., 'var_positional'),), ...))
-        self.assertEqual(self.signature(A.f4), 
+        self.assertEqual(self.signature(A.f4),
                          ((('args', ..., ..., 'var_positional'),
                             ('kwargs', ..., ..., 'var_keyword')), ...))
     @cpython_only
diff --git a/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt b/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt
index dc7c5f0..1b5335b 100644
--- a/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt
+++ b/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt
@@ -1,5 +1,5 @@
 # -*- coding: latin1 -*-
-# IMPORTANT: this file has the utf-8 BOM signature '\xef\xbb\xbf' 
+# IMPORTANT: this file has the utf-8 BOM signature '\xef\xbb\xbf'
 # at the start of it.  Make sure this is preserved if any changes
 # are made!  Also note that the coding cookie above conflicts with
 # the presence of a utf-8 BOM signature -- this is intended.
diff --git a/Lib/test/tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt b/Lib/test/tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt
index 81931c4..23fd216 100644
--- a/Lib/test/tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt
+++ b/Lib/test/tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt
@@ -1,4 +1,4 @@
-# IMPORTANT: this file has the utf-8 BOM signature '\xef\xbb\xbf' 
+# IMPORTANT: this file has the utf-8 BOM signature '\xef\xbb\xbf'
 # at the start of it.  Make sure this is preserved if any changes
 # are made!
 
diff --git a/Lib/test/tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt b/Lib/test/tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt
index 74568a7..4b20ff6 100644
--- a/Lib/test/tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt
+++ b/Lib/test/tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# IMPORTANT: this file has the utf-8 BOM signature '\xef\xbb\xbf' 
+# IMPORTANT: this file has the utf-8 BOM signature '\xef\xbb\xbf'
 # at the start of it.  Make sure this is preserved if any changes
 # are made!
 
diff --git a/Lib/test/tokenize_tests.txt b/Lib/test/tokenize_tests.txt
index 2c5fb10..c4f5a58 100644
--- a/Lib/test/tokenize_tests.txt
+++ b/Lib/test/tokenize_tests.txt
@@ -1,5 +1,5 @@
 # Tests for the 'tokenize' module.
-# Large bits stolen from test_grammar.py. 
+# Large bits stolen from test_grammar.py.
 
 # Comments
 "#"
diff --git a/Lib/venv/scripts/posix/activate.fish b/Lib/venv/scripts/posix/activate.fish
index 4d4f0bd..b401058 100644
--- a/Lib/venv/scripts/posix/activate.fish
+++ b/Lib/venv/scripts/posix/activate.fish
@@ -52,7 +52,7 @@
         set -l old_status $status
 
         # Prompt override?
-        if test -n "__VENV_PROMPT__"            
+        if test -n "__VENV_PROMPT__"
             printf "%s%s" "__VENV_PROMPT__" (set_color normal)
         else
             # ...Otherwise, prepend env
diff --git a/Modules/expat/pyexpatns.h b/Modules/expat/pyexpatns.h
index 999c5c7..cfb742e 100644
--- a/Modules/expat/pyexpatns.h
+++ b/Modules/expat/pyexpatns.h
@@ -26,7 +26,7 @@
  * http://lxr.mozilla.org/seamonkey/source/modules/libimg/png/mozpngconf.h#115
  *
  * The list of relevant exported symbols can be had with this command:
- * 
+ *
        nm pyexpat.so \
            | grep -v " [a-zBUA] " \
            | grep -v "_fini\|_init\|initpyexpat"
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index 03dbf18..e0d50df 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -199,7 +199,7 @@
 #ifdef HAVE_SOCKADDR_ALG
     struct sockaddr_alg alg;
 #endif
-#ifdef AF_VSOCK 
+#ifdef AF_VSOCK
     struct sockaddr_vm vm;
 #endif
 } sock_addr_t;
diff --git a/Objects/cellobject.c b/Objects/cellobject.c
index 3f6389f..8f16f07 100644
--- a/Objects/cellobject.c
+++ b/Objects/cellobject.c
@@ -151,7 +151,7 @@
 }
 
 static PyGetSetDef cell_getsetlist[] = {
-    {"cell_contents", (getter)cell_get_contents, 
+    {"cell_contents", (getter)cell_get_contents,
                       (setter)cell_set_contents, NULL},
     {NULL} /* sentinel */
 };
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 8772e58..cd5d2dd 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -23,7 +23,7 @@
 
    Unlike the dictionary implementation, the lookkey function can return
    NULL if the rich comparison returns an error.
-   
+
    Use cases for sets differ considerably from dictionaries where looked-up
    keys are more likely to be present.  In contrast, sets are primarily
    about membership testing where the presence of an element is not known in
diff --git a/PC/_testconsole.c b/PC/_testconsole.c
index 1c93679..23d1286 100644
--- a/PC/_testconsole.c
+++ b/PC/_testconsole.c
@@ -46,7 +46,7 @@
 /*[clinic end generated code: output=48f9563db34aedb3 input=4c774f2d05770bc6]*/
 {
     INPUT_RECORD *rec = NULL;
-    
+
     if (!PyWindowsConsoleIO_Check(file)) {
         PyErr_SetString(PyExc_TypeError, "expected raw console object");
         return NULL;
@@ -59,7 +59,7 @@
     if (!rec)
         goto error;
     memset(rec, 0, sizeof(INPUT_RECORD) * size);
-    
+
     INPUT_RECORD *prec = rec;
     for (DWORD i = 0; i < size; ++i, ++p, ++prec) {
         prec->EventType = KEY_EVENT;
@@ -80,7 +80,7 @@
     }
 
     PyMem_Free((void*)rec);
-    
+
     Py_RETURN_NONE;
 error:
     if (rec)
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c
index 81d2db3..c4113e5 100644
--- a/PC/msvcrtmodule.c
+++ b/PC/msvcrtmodule.c
@@ -359,7 +359,7 @@
 /*[clinic end generated code: output=c6942a0efa119000 input=22f07ee9001bbf0f]*/
 {
     int res;
-    
+
     _Py_BEGIN_SUPPRESS_IPH
     res = _ungetch(char_value);
     _Py_END_SUPPRESS_IPH
diff --git a/Programs/_testembed.c b/Programs/_testembed.c
index 94a3c3d..e68e68d 100644
--- a/Programs/_testembed.c
+++ b/Programs/_testembed.c
@@ -127,7 +127,7 @@
 
 /* *********************************************************
  * List of test cases and the function that implements it.
- * 
+ *
  * Names are compared case-sensitively with the first
  * argument. If no match is found, or no first argument was
  * provided, the names of all test cases are printed and
@@ -135,7 +135,7 @@
  *
  * The int returned from test functions is used as the exit
  * code, and test_capi treats all non-zero exit codes as a
- * failed test. 
+ * failed test.
  *********************************************************/
 struct TestCase
 {
diff --git a/Tools/freeze/test/Makefile b/Tools/freeze/test/Makefile
index 1679f72..b889e89 100644
--- a/Tools/freeze/test/Makefile
+++ b/Tools/freeze/test/Makefile
@@ -8,4 +8,4 @@
 	$(PYTHON) ../freeze.py -o $(OUTDIR) ok.py
 	make -C $(OUTDIR)
 	$(OUTDIR)/ok
-	
+
diff --git a/aclocal.m4 b/aclocal.m4
index 2a745e5..4eb2dc3 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -170,7 +170,7 @@
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
 	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
-        else 
+        else
 	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs