Skip to content

Commit 6534bf3

Browse files
committed
Try to fix mypyc issues
1 parent c415851 commit 6534bf3

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

mypy/stubutil.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from typing import Iterable, Iterator, Mapping
1212
from typing_extensions import Final, overload
1313

14+
from mypy_extensions import mypyc_attr
15+
1416
import mypy.options
1517
from mypy.modulefinder import ModuleNotFoundReason
1618
from mypy.moduleinspect import InspectError, ModuleInspect
@@ -326,6 +328,7 @@ def infer_method_ret_type(name: str) -> str | None:
326328
return None
327329

328330

331+
@mypyc_attr(allow_interpreted_subclasses=True)
329332
class SignatureGenerator:
330333
"""Abstract base class for extracting a list of FunctionSigs for each function."""
331334

@@ -479,6 +482,7 @@ def import_lines(self) -> list[str]:
479482
return result
480483

481484

485+
@mypyc_attr(allow_interpreted_subclasses=True)
482486
class BaseStubGenerator:
483487
# These names should be omitted from generated stubs.
484488
IGNORED_DUNDERS: Final = {

mypy/traverser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from mypy_extensions import mypyc_attr
5+
from mypy_extensions import mypyc_attr, trait
66

77
from mypy.nodes import (
88
REVEAL_TYPE,
@@ -94,6 +94,7 @@
9494
from mypy.visitor import NodeVisitor
9595

9696

97+
@trait
9798
@mypyc_attr(allow_interpreted_subclasses=True)
9899
class TraverserVisitor(NodeVisitor[None]):
99100
"""A parse tree visitor that traverses the parse tree during visiting.

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,8 @@ def run(self):
110110
"version.py",
111111
# Skip these to reduce the size of the build
112112
"stubtest.py",
113-
"stubgen.py",
114113
"stubgenc.py",
115114
"stubdoc.py",
116-
"stubutil.py",
117115
)
118116
) + (
119117
# Don't want to grab this accidentally

0 commit comments

Comments
 (0)