Skip to content

Commit 8676e1b

Browse files
committed
Type the __init__ and util files
1 parent be0fe13 commit 8676e1b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/pytest_html/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# type: ignore
21
try:
32
from . import __version
43

src/pytest_html/util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
# type: ignore
21
import importlib
32
from functools import lru_cache
3+
from types import ModuleType
4+
from typing import Optional
45

56

67
@lru_cache()
7-
def ansi_support():
8+
def ansi_support() -> Optional[ModuleType]:
89
try:
910
# from ansi2html import Ansi2HTMLConverter, style # NOQA
1011
return importlib.import_module("ansi2html")
1112
except ImportError:
1213
# ansi2html is not installed
13-
pass
14+
return None

0 commit comments

Comments
 (0)