gh-121277: Raise nice error on `next` as second argument to deprecated-removed (GH-124623)

This commit is contained in:
Petr Viktorin 2024-09-27 19:38:40 +02:00 committed by GitHub
parent 6716dd1c33
commit e349f73a5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -288,6 +288,9 @@ def run(self):
version_deprecated = expand_version_arg(self.arguments[0], version_deprecated = expand_version_arg(self.arguments[0],
self.config.release) self.config.release)
version_removed = self.arguments.pop(1) 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 self.arguments[0] = version_deprecated, version_removed
# Set the label based on if we have reached the removal version # Set the label based on if we have reached the removal version