10000 Merge pull request #17452 from anntzer/validate_date · matplotlib/matplotlib@2bdfea8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2bdfea8

Browse files
authored
Merge pull request #17452 from anntzer/validate_date
Make validate_date throw ValueError, not RuntimeError.
2 parents 6c02d68 + 6d49644 commit 2bdfea8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def _validate_date(s):
126126
np.datetime64(s)
127127
return s
128128
except ValueError:
129-
raise RuntimeError('"%s" should be a string that can be parsed by ',
130-
'numpy.datetime64.' % s)
129+
raise ValueError(
130+
f'{s!r} should be a string that can be parsed by numpy.datetime64')
131131

132132

133133
@cbook.deprecated("3.2", alternative="os.path.exists")

0 commit comments

Comments
 (0)
0