Skip to content

Commit 566f013

Browse files
committed
fix py37 compatibility
1 parent 78451f4 commit 566f013

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

pdoc/search.py

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
```
3737
in your [`module.html.jinja2` template](../pdoc.html#editing-pdocs-html-template).
3838
"""
39+
from __future__ import annotations
40+
3941
import json
4042
import shutil
4143
import subprocess

pdoc/web.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ def __init__(
106106
self,
107107
addr: tuple[str, int],
108108
all_modules: Collection[str],
109+
**kwargs
109110
):
110-
super().__init__(addr, DocHandler)
111+
super().__init__(addr, DocHandler, **kwargs) # type: ignore
111112
self.all_modules = all_modules
112113

113114
@cache

test/test_doc.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import builtins
22
import dataclasses
3+
import sys
34
from pathlib import Path
45
from unittest.mock import patch
56

@@ -88,6 +89,7 @@ def test_builtin_source_file():
8889
assert m.source_file is None
8990

9091

92+
@pytest.mark.skipif(sys.version_info < (3, 9), reason="3.9+ only")
9193
def test_raising_getdoc():
9294
class Foo:
9395
@classmethod

test/test_web.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def run(self) -> None:
2323

2424

2525
def handle_request(data: bytes) -> bytes:
26-
server = DocServer(("", 8080), all_modules=["dataclasses", "err", "markupsafe"])
26+
server = DocServer(("", 8080), all_modules=["dataclasses", "err", "markupsafe"], bind_and_activate=False)
2727
a, b = socket.socketpair()
2828
b.send(data)
2929
t = ReadResponse(b)

0 commit comments

Comments
 (0)