mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix mypy violations
This commit is contained in:
parent
0da80cf302
commit
d4fa830d6e
@ -392,9 +392,10 @@ def parselinenos(spec, total):
|
||||
elif len(begend) == 1:
|
||||
items.append(int(begend[0]) - 1)
|
||||
elif len(begend) == 2:
|
||||
start, end = begend
|
||||
start = int(start or 1) # left half open (cf. -10)
|
||||
end = int(end or max(start, total)) # right half open (cf. 10-)
|
||||
start = int(begend[0] or 1) # type: ignore
|
||||
# left half open (cf. -10)
|
||||
end = int(begend[1] or max(start, total)) # type: ignore
|
||||
# right half open (cf. 10-)
|
||||
if start > end: # invalid range (cf. 10-1)
|
||||
raise ValueError
|
||||
items.extend(range(start - 1, end))
|
||||
|
Loading…
Reference in New Issue
Block a user