Skip to content

Commit 6efbff4

Browse files
authored
stubtest: workaround mypyc (python#8411)
1 parent e91bc22 commit 6efbff4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mypy/stubtest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import warnings
1515
from functools import singledispatch
1616
from pathlib import Path
17-
from typing import Any, Dict, Generic, Iterator, List, Optional, Tuple, TypeVar, Union
17+
from typing import Any, Dict, Generic, Iterator, List, Optional, Tuple, TypeVar, Union, cast
1818

1919
from typing_extensions import Type
2020

@@ -236,7 +236,8 @@ def verify_typeinfo(
236236
return
237237

238238
to_check = set(stub.names)
239-
to_check.update(m for m in vars(runtime) if not m.startswith("_"))
239+
# cast to workaround mypyc complaints
240+
to_check.update(m for m in cast(Any, vars)(runtime) if not m.startswith("_"))
240241

241242
for entry in sorted(to_check):
242243
yield from verify(

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def run(self):
101101
# Also I think there would be problems with how we generate version.py.
102102
'version.py',
103103

104-
# Written by someone who doesn't know how to deal with mypyc
104+
# Can be removed once we drop support for Python 3.5.2 and lower.
105105
'stubtest.py',
106106
)) + (
107107
# Don't want to grab this accidentally

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy