Skip to content

Conversation

@sobolevn
Copy link
Member

@sobolevn sobolevn commented Jun 1, 2023

It used to be a string, but actually passing remove=3.11 will give you a TypeError. Example:

>>> import warnings
>>> warnings._deprecated('a', remove='3.11')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/sobolev/Desktop/cpython/Lib/warnings.py", line 524, in _deprecated
    if (_version[:2] > remove) or (_version[:2] == remove and _version[3] != "alpha"):
        ^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'tuple' and 'str'

So, I've changed it to be a tuple intead, as it should be.

I don't think that this PR is worth an issue / news entry.

@sobolevn
Copy link
Member Author

sobolevn commented Jun 1, 2023

@CAM-Gerlach would you like to take a look? :)

@AlexWaygood AlexWaygood enabled auto-merge (squash) June 1, 2023 07:42
@AlexWaygood AlexWaygood merged commit 201440e into python:main Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants