[Python-checkins] gh-104683: Argument clinic: Make the `filename` parameter to `Clinic` required (#107439)

AlexWaygood webhook-mailer at python.org
Sat Jul 29 14:46:55 EDT 2023


https://github.com/python/cpython/commit/6c74b2f66957912d4202869939499864ca268e23
commit: 6c74b2f66957912d4202869939499864ca268e23
branch: main
author: Alex Waygood <Alex.Waygood at Gmail.com>
committer: AlexWaygood <Alex.Waygood at Gmail.com>
date: 2023-07-29T19:46:52+01:00
summary:

gh-104683: Argument clinic: Make the `filename` parameter to `Clinic` required (#107439)

files:
M Tools/clinic/clinic.py

diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index cb999c156ee28..3c16dc389e3eb 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -2015,7 +2015,6 @@ def __post_init__(self, args: tuple[str, ...]) -> None:
         if self.type =='file':
             d = {}
             filename = self.clinic.filename
-            assert filename is not None
             d['path'] = filename
             dirname, basename = os.path.split(filename)
             if not dirname:
@@ -2133,8 +2132,8 @@ def __init__(
             language: CLanguage,
             printer: BlockPrinter | None = None,
             *,
+            filename: str,
             verify: bool = True,
-            filename: str | None = None
     ) -> None:
         # maps strings to Parser objects.
         # (instantiated from the "parsers" global.)



More information about the Python-checkins mailing list