Skip to content

Commit e203639

Browse files
committed
gh-152060: Address review — simplify error message, drop duplicate test case
1 parent d2b66b9 commit e203639

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/_pydatetime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def _parse_isoformat_date(dtstr):
359359
# It is assumed that this is an ASCII-only string of lengths 7, 8 or 10,
360360
# see the comment on Modules/_datetimemodule.c:_find_isoformat_datetime_separator
361361
if len(dtstr) not in (7, 8, 10):
362-
raise ValueError(f"Invalid isoformat string: {dtstr!r}")
362+
raise ValueError("Invalid isoformat string")
363363
year = int(dtstr[0:4])
364364
has_sep = dtstr[4] == '-'
365365

Lib/test/datetimetester.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3758,7 +3758,6 @@ def test_fromisoformat_fails_datetime(self):
37583758
'2009-04-19T12:30:45-00:90:00', # Time zone field out from range
37593759
'2009-04-19T12:30:45-00:00:90', # Time zone field out from range
37603760
'2020-2020', # Ambiguous 9-char date portion
3761-
'2020-1234', # Ambiguous 9-char date portion
37623761
]
37633762

37643763
for bad_str in bad_strs:

0 commit comments

Comments
 (0)