Skip to content

Commit f1f1ff9

Browse files
committed
Fix mypy errors
1 parent f00dc15 commit f1f1ff9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

sphinxcontrib/devhelp/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import gzip
1414
import re
1515
from os import path
16-
from typing import Any, Dict
16+
from typing import TYPE_CHECKING, Any, Dict
1717

1818
from docutils import nodes
1919
from sphinx import addnodes
@@ -31,8 +31,9 @@
3131
import lxml.etree as etree # type: ignore
3232

3333

34-
if False:
34+
if TYPE_CHECKING:
3535
# For type annotation
36+
from pathlib import Path
3637
from typing import List # NOQA
3738

3839
__version__ = '1.0.3'
@@ -74,7 +75,7 @@ def handle_finish(self):
7475
self.build_devhelp(self.outdir, self.config.devhelp_basename)
7576

7677
def build_devhelp(self, outdir, outname):
77-
# type: (str, str) -> None
78+
# type: (Path, str) -> None
7879
logger.info(__('dumping devhelp index...'))
7980

8081
# Basic info

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ extras =
3333
test
3434
lint
3535
commands=
36-
mypy sphinxcontrib/
36+
mypy sphinxcontrib/ --explicit-package-bases

0 commit comments

Comments
 (0)