Skip to content

Commit 5df8b0d

Browse files
gh-95065: Argument Clinic: Add comment to preprocessor warning code (#107766)
1 parent de72677 commit 5df8b0d

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

Lib/test/clinic.test.c

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5524,6 +5524,7 @@ test_deprecate_positional_pos1_len1_optional(PyObject *module, PyObject *const *
55245524
PyObject *a;
55255525
PyObject *b = Py_None;
55265526

5527+
// Emit compiler warnings when we get to Python 3.14.
55275528
#if PY_VERSION_HEX >= 0x030e00C0
55285529
# error \
55295530
"In clinic.test.c, update parameter(s) 'b' in the clinic input of" \
@@ -5571,7 +5572,7 @@ test_deprecate_positional_pos1_len1_optional(PyObject *module, PyObject *const *
55715572
static PyObject *
55725573
test_deprecate_positional_pos1_len1_optional_impl(PyObject *module,
55735574
PyObject *a, PyObject *b)
5574-
/*[clinic end generated code: output=6c0fd9d94fa1e765 input=89099f3dacd757da]*/
5575+
/*[clinic end generated code: output=144cbf1adc574dd9 input=89099f3dacd757da]*/
55755576

55765577

55775578
/*[clinic input]
@@ -5630,6 +5631,7 @@ test_deprecate_positional_pos1_len1(PyObject *module, PyObject *const *args, Py_
56305631
PyObject *a;
56315632
PyObject *b;
56325633

5634+
// Emit compiler warnings when we get to Python 3.14.
56335635
#if PY_VERSION_HEX >= 0x030e00C0
56345636
# error \
56355637
"In clinic.test.c, update parameter(s) 'b' in the clinic input of" \
@@ -5669,7 +5671,7 @@ test_deprecate_positional_pos1_len1(PyObject *module, PyObject *const *args, Py_
56695671
static PyObject *
56705672
test_deprecate_positional_pos1_len1_impl(PyObject *module, PyObject *a,
56715673
PyObject *b)
5672-
/*[clinic end generated code: output=22821a0fa9945d0c input=1702bbab1e9b3b99]*/
5674+
/*[clinic end generated code: output=994bd57c1c634709 input=1702bbab1e9b3b99]*/
56735675

56745676

56755677
/*[clinic input]
@@ -5735,6 +5737,7 @@ test_deprecate_positional_pos1_len2_with_kwd(PyObject *module, PyObject *const *
57355737
PyObject *c;
57365738
PyObject *d;
57375739

5740+
// Emit compiler warnings when we get to Python 3.14.
57385741
#if PY_VERSION_HEX >= 0x030e00C0
57395742
# error \
57405743
"In clinic.test.c, update parameter(s) 'b' and 'c' in the clinic " \
@@ -5781,7 +5784,7 @@ static PyObject *
57815784
test_deprecate_positional_pos1_len2_with_kwd_impl(PyObject *module,
57825785
PyObject *a, PyObject *b,
57835786
PyObject *c, PyObject *d)
5784-
/*[clinic end generated code: output=061d554ccc6b8f51 input=28cdb885f6c34eab]*/
5787+
/*[clinic end generated code: output=146c60ecbcdbf4b8 input=28cdb885f6c34eab]*/
57855788

57865789

57875790
/*[clinic input]
@@ -5837,6 +5840,7 @@ test_deprecate_positional_pos0_len1(PyObject *module, PyObject *const *args, Py_
58375840
PyObject *argsbuf[1];
58385841
PyObject *a;
58395842

5843+
// Emit compiler warnings when we get to Python 3.14.
58405844
#if PY_VERSION_HEX >= 0x030e00C0
58415845
# error \
58425846
"In clinic.test.c, update parameter(s) 'a' in the clinic input of" \
@@ -5874,7 +5878,7 @@ test_deprecate_positional_pos0_len1(PyObject *module, PyObject *const *args, Py_
58745878

58755879
static PyObject *
58765880
test_deprecate_positional_pos0_len1_impl(PyObject *module, PyObject *a)
5877-
/*[clinic end generated code: output=3e512117a5eda970 input=678206db25c0652c]*/
5881+
/*[clinic end generated code: output=dce99971a2494f9f input=678206db25c0652c]*/
58785882

58795883

58805884
/*[clinic input]
@@ -5933,6 +5937,7 @@ test_deprecate_positional_pos0_len2(PyObject *module, PyObject *const *args, Py_
59335937
PyObject *a;
59345938
PyObject *b;
59355939

5940+
// Emit compiler warnings when we get to Python 3.14.
59365941
#if PY_VERSION_HEX >= 0x030e00C0
59375942
# error \
59385943
"In clinic.test.c, update parameter(s) 'a' and 'b' in the clinic " \
@@ -5975,7 +5980,7 @@ test_deprecate_positional_pos0_len2(PyObject *module, PyObject *const *args, Py_
59755980
static PyObject *
59765981
test_deprecate_positional_pos0_len2_impl(PyObject *module, PyObject *a,
59775982
PyObject *b)
5978-
/*[clinic end generated code: output=d41da050a5b82dd0 input=fae0d0b1d480c939]*/
5983+
/*[clinic end generated code: output=06999692e0c8dac4 input=fae0d0b1d480c939]*/
59795984

59805985

59815986
/*[clinic input]
@@ -6044,6 +6049,7 @@ test_deprecate_positional_pos0_len3_with_kwdonly(PyObject *module, PyObject *con
60446049
PyObject *c;
60456050
PyObject *e;
60466051

6052+
// Emit compiler warnings when we get to Python 3.14.
60476053
#if PY_VERSION_HEX >= 0x030e00C0
60486054
# error \
60496055
"In clinic.test.c, update parameter(s) 'a', 'b' and 'c' in the " \
@@ -6095,7 +6101,7 @@ test_deprecate_positional_pos0_len3_with_kwdonly_impl(PyObject *module,
60956101
PyObject *b,
60966102
PyObject *c,
60976103
PyObject *e)
6098-
/*[clinic end generated code: output=c5d7ddfc139ddf31 input=1b0121770c0c52e0]*/
6104+
/*[clinic end generated code: output=a553e33101dc42b2 input=1b0121770c0c52e0]*/
60996105

61006106

61016107
/*[clinic input]
@@ -6156,6 +6162,7 @@ test_deprecate_positional_pos2_len1(PyObject *module, PyObject *const *args, Py_
61566162
PyObject *b;
61576163
PyObject *c;
61586164

6165+
// Emit compiler warnings when we get to Python 3.14.
61596166
#if PY_VERSION_HEX >= 0x030e00C0
61606167
# error \
61616168
"In clinic.test.c, update parameter(s) 'c' in the clinic input of" \
@@ -6196,7 +6203,7 @@ test_deprecate_positional_pos2_len1(PyObject *module, PyObject *const *args, Py_
61966203
static PyObject *
61976204
test_deprecate_positional_pos2_len1_impl(PyObject *module, PyObject *a,
61986205
PyObject *b, PyObject *c)
6199-
/*[clinic end generated code: output=d80609e6b37ffb8a input=e1d129689e69ec7c]*/
6206+
/*[clinic end generated code: output=f96454a4970b443c input=e1d129689e69ec7c]*/
62006207

62016208

62026209
/*[clinic input]
@@ -6260,6 +6267,7 @@ test_deprecate_positional_pos2_len2(PyObject *module, PyObject *const *args, Py_
62606267
PyObject *c;
62616268
PyObject *d;
62626269

6270+
// Emit compiler warnings when we get to Python 3.14.
62636271
#if PY_VERSION_HEX >= 0x030e00C0
62646272
# error \
62656273
"In clinic.test.c, update parameter(s) 'c' and 'd' in the clinic " \
@@ -6305,7 +6313,7 @@ static PyObject *
63056313
test_deprecate_positional_pos2_len2_impl(PyObject *module, PyObject *a,
63066314
PyObject *b, PyObject *c,
63076315
PyObject *d)
6308-
/*[clinic end generated code: output=1c10d6197562319f input=0d53533463a12792]*/
6316+
/*[clinic end generated code: output=5e648e887da0a804 input=0d53533463a12792]*/
63096317

63106318

63116319
/*[clinic input]
@@ -6377,6 +6385,7 @@ test_deprecate_positional_pos2_len3_with_kwdonly(PyObject *module, PyObject *con
63776385
PyObject *d;
63786386
PyObject *e;
63796387

6388+
// Emit compiler warnings when we get to Python 3.14.
63806389
#if PY_VERSION_HEX >= 0x030e00C0
63816390
# error \
63826391
"In clinic.test.c, update parameter(s) 'c' and 'd' in the clinic " \
@@ -6427,4 +6436,4 @@ test_deprecate_positional_pos2_len3_with_kwdonly_impl(PyObject *module,
64276436
PyObject *c,
64286437
PyObject *d,
64296438
PyObject *e)
6430-
/*[clinic end generated code: output=d32375ffce63d3db input=154fd450448d8935]*/
6439+
/*[clinic end generated code: output=383d56b03f7c2dcb input=154fd450448d8935]*/

Tools/clinic/clinic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,7 @@ class CLanguage(Language):
850850
#endif /* !defined({methoddef_name}) */
851851
""")
852852
DEPRECATED_POSITIONAL_PROTOTYPE: Final[str] = r"""
853+
// Emit compiler warnings when we get to Python {major}.{minor}.
853854
#if PY_VERSION_HEX >= 0x{major:02x}{minor:02x}00C0
854855
# error \
855856
{cpp_message}

0 commit comments

Comments
 (0)