We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c0d4f8 commit 8c6fd9bCopy full SHA for 8c6fd9b
1 file changed
Doc/library/datetime.rst
@@ -2631,8 +2631,12 @@ will be pulled from the default value.
2631
.. doctest::
2632
2633
>>> from datetime import datetime
2634
+ >>> import warnings
2635
>>> value = "2/29"
- >>> datetime.strptime(value, "%m/%d")
2636
+ >>> with warnings.catch_warnings():
2637
+ ... warnings.simplefilter("ignore")
2638
+ ... datetime.strptime(value, "%m/%d")
2639
+ ...
2640
Traceback (most recent call last):
2641
...
2642
ValueError: day 29 must be in range 1..28 for month 2 in year 1900
0 commit comments