Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5c9aa4

Browse files
author
LindyBalboa
committed
Consolidate DayLocator interval checks
1 parent 7f8c295 commit b5c9aa4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/matplotlib/dates.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,12 +1241,8 @@ def __init__(self, bymonthday=None, interval=1, tz=None):
12411241
12421242
Default is to tick every day of the month: ``bymonthday=range(1,32)``
12431243
"""
1244-
if interval < 1:
1245-
raise ValueError("The interval parameter must be an integer "
1246-
"greater than or equal to one.")
1247-
if not isinstance(interval, int):
1248-
raise ValueError("The interval parameter must be an integer "
1249-
"greater than or equal to one.")
1244+
if not interval == int(interval) or interval < 1:
1245+
raise ValueError("interval must be an integer greater than 0")
12501246
if bymonthday is None:
12511247
bymonthday = range(1, 32)
12521248
elif isinstance(bymonthday, np.ndarray):

0 commit comments

Comments
 (0)