From d4fa830d6ee792a8dabcaf489336d1ffe90ce38d Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 18 Feb 2017 01:19:32 +0900 Subject: [PATCH] Fix mypy violations --- sphinx/util/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index f46ce871b..e3cb27896 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -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))