8000 Make validate_date throw ValueError, not RuntimeError. · matplotlib/matplotlib@6d49644 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6d49644

Browse files
committed
Make validate_date throw ValueError, not RuntimeError.
... consistently with most other validators. As this API is new in 3.3 it would be nice to merge this PR in 3.3 too.
1 parent 5698325 commit 6d49644

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