]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix typos in comments (#123201)
authorWulian <1055917385@qq.com>
Wed, 21 Aug 2024 12:49:23 +0000 (20:49 +0800)
committerGitHub <noreply@github.com>
Wed, 21 Aug 2024 12:49:23 +0000 (12:49 +0000)
Lib/test/test_asyncio/test_timeouts.py
Lib/test/test_capi/test_exceptions.py
Lib/test/test_pdb.py
Lib/test/test_statistics.py
Lib/test/test_typing.py
Lib/test/test_unicodedata.py
Lib/tkinter/__init__.py
Modules/_ctypes/_ctypes_test.c
Objects/object.c

index 1f7f9ee696a525bfd13bd45d33f4941158df4258..f5543e191d07ff9b85037ec01543b23d7d92be4d 100644 (file)
@@ -220,7 +220,7 @@ class TimeoutTests(unittest.IsolatedAsyncioTestCase):
                         # Pretend the loop is busy for a while.
                         time.sleep(0.1)
                         await asyncio.sleep(1)
-                # TimeoutError was cought by (2)
+                # TimeoutError was caught by (2)
                 await asyncio.sleep(10) # This sleep should be interrupted by (1)
         t1 = loop.time()
         self.assertTrue(t0 <= t1 <= t0 + 1)
index c475b6d78d0c56d0cb20428f0b05944988dc1e67..b22ddd8ad858d4823d66d67bf7ff3b2862f3bc23 100644 (file)
@@ -104,7 +104,7 @@ class Test_Exceptions(unittest.TestCase):
         ''')
         proc = assert_python_ok("-c", code)
         warnings = proc.err.splitlines()
-        # Due to the finalization of the interpreter, the source will be ommited
+        # Due to the finalization of the interpreter, the source will be omitted
         # because the ``warnings`` module cannot be imported at this time
         self.assertEqual(warnings, [
             b'<string>:7: RuntimeWarning: Testing PyErr_WarnEx',
index 9395e9b133f50dbda47c279d41d773d9ca209689..db7d1b1e9cd935c7e4f118454c3938bfcd9332fe 100644 (file)
@@ -1263,7 +1263,7 @@ def test_post_mortem_context_of_the_cause():
 def test_post_mortem_from_none():
     """Test post mortem traceback debugging of chained exception
 
-    In particular that cause from None (which sets __supress_context__ to True)
+    In particular that cause from None (which sets __suppress_context__ to True)
     does not show context.
 
 
index 89201c647dfe515c2199244eeff42d27abf43c62..c69baa4bf4d1b11f2cbadbb312a4f18e1046a279 100644 (file)
@@ -2799,7 +2799,7 @@ class TestCorrelationAndCovariance(unittest.TestCase):
     @requires_IEEE_754
     @unittest.skipIf(HAVE_DOUBLE_ROUNDING,
                      "accuracy not guaranteed on machines with double rounding")
-    @support.cpython_only    # Allow for a weaker sumprod() implmentation
+    @support.cpython_only    # Allow for a weaker sumprod() implementation
     def test_sqrtprod_helper_function_improved_accuracy(self):
         # Test a known example where accuracy is improved
         x, y, target = 0.8035720646477457, 0.7957468097636939, 0.7996498651651661
index ef2ad30317bf342815b41edbacdbac59d5d6fa7a..6e036b600330c17cdf1e56f296163ec8e244739e 100644 (file)
@@ -2500,7 +2500,7 @@ class BaseCallableTests:
 
     def test_nested_paramspec(self):
         # Since Callable has some special treatment, we want to be sure
-        # that substituion works correctly, see gh-103054
+        # that substitution works correctly, see gh-103054
         Callable = self.Callable
         P = ParamSpec('P')
         P2 = ParamSpec('P2')
index d3bf4ea7c7d437aac38ce08d09f4d4e581e34849..5f572c4cf9a5c5057bcf01278ff9fb1bac8b5d77 100644 (file)
@@ -114,7 +114,7 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
 
     def test_lookup_nonexistant(self):
         # just make sure that lookup can fail
-        for nonexistant in [
+        for nonexistent in [
             "LATIN SMLL LETR A",
             "OPEN HANDS SIGHS",
             "DREGS",
@@ -122,7 +122,7 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
             "MODIFIER LETTER CYRILLIC SMALL QUESTION MARK",
             "???",
         ]:
-            self.assertRaises(KeyError, self.db.lookup, nonexistant)
+            self.assertRaises(KeyError, self.db.lookup, nonexistent)
 
     def test_digit(self):
         self.assertEqual(self.db.digit('A', None), None)
index 5352276e874bf524a17feef056a1e1c9a18dbc57..2e5affb15e3f6159184a713d9d543124cec1be87 100644 (file)
@@ -4490,7 +4490,7 @@ class PhotoImage(Image):
         The FORMAT option specifies the name of the image file format
         handler to be used.  If this option is not given, this method uses
         a format that consists of a tuple (one element per row) of strings
-        containings space separated (one element per pixel/column) colors
+        containing space-separated (one element per pixel/column) colors
         in “#RRGGBB” format (where RR is a pair of hexadecimal digits for
         the red channel, GG for green, and BB for blue).
 
index 0719a1b921f0405052f5e30f84c3ca887965c3b2..8e07584f0749365fdd8535e561d9ece4c86b4e66 100644 (file)
@@ -187,8 +187,8 @@ _testfunc_array_in_struct3B_set_defaults(void)
 /*
  * Test3C struct tests the MAX_STRUCT_SIZE 32. Structs containing arrays of up
  * to four floating-point types are passed in registers on Arm platforms.
- * This struct is used for within bounds test on Arm platfroms and for an
- * out-of-bounds tests for platfroms where MAX_STRUCT_SIZE is less than 32.
+ * This struct is used for within-bounds tests on Arm platforms and for an
+ * out-of-bounds test for platforms where MAX_STRUCT_SIZE is less than 32.
  * See gh-110190.
  */
 typedef struct {
index c6d46caa0bb62b5d628086a72000b2fc445d9b25..97403227625971a6829bbe6ea724778e8733ed4b 100644 (file)
@@ -1258,9 +1258,9 @@ PyObject_GetOptionalAttr(PyObject *v, PyObject *name, PyObject **result)
         return 0;
     }
     if (tp->tp_getattro == _Py_type_getattro) {
-        int supress_missing_attribute_exception = 0;
-        *result = _Py_type_getattro_impl((PyTypeObject*)v, name, &supress_missing_attribute_exception);
-        if (supress_missing_attribute_exception) {
+        int suppress_missing_attribute_exception = 0;
+        *result = _Py_type_getattro_impl((PyTypeObject*)v, name, &suppress_missing_attribute_exception);
+        if (suppress_missing_attribute_exception) {
             // return 0 without having to clear the exception
             return 0;
         }