From 3cc4298fc0ed5646f937838dc9a74cbaf54e7268 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 26 Sep 2024 10:16:28 -0700 Subject: [PATCH] gh-121277: Raise nice error on `next` as second argument to deprecated-removed --- Doc/tools/extensions/pyspecific.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 1f725c2377035b..c89b1693343b4e 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -288,6 +288,9 @@ def run(self): version_deprecated = expand_version_arg(self.arguments[0], self.config.release) version_removed = self.arguments.pop(1) + if version_removed == 'next': + raise ValueError( + 'deprecated-removed:: second argument cannot be `next`') self.arguments[0] = version_deprecated, version_removed # Set the label based on if we have reached the removal version