From 32136baba21712ca35e4061b83adfa2a860d49f8 Mon Sep 17 00:00:00 2001 From: sanyamk23 Date: Fri, 31 Jul 2026 22:37:36 +0530 Subject: [PATCH] Fix type narrowing with not isinstance(x, cls) in classmethods --- misc/dump-ast.py | 2 +- misc/upload-pypi.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/misc/dump-ast.py b/misc/dump-ast.py index 7fdf905bae0b4..68ea8bc0dc61e 100755 --- a/misc/dump-ast.py +++ b/misc/dump-ast.py @@ -19,7 +19,7 @@ def dump(fname: str, python_version: tuple[int, int], quiet: bool = False) -> No options.python_version = python_version with open(fname, "rb") as f: s = f.read() - tree = parse(s, fname, None, errors=Errors(options), options=options) + tree = parse(s, fname, None, errors=Errors(options), options=options, file_exists=True) if not quiet: print(tree) diff --git a/misc/upload-pypi.py b/misc/upload-pypi.py index 52092bd288f0f..8ea86bbea584b 100644 --- a/misc/upload-pypi.py +++ b/misc/upload-pypi.py @@ -31,7 +31,16 @@ def is_whl_or_tar(name: str) -> bool: def item_ok_for_pypi(name: str) -> bool: - return is_whl_or_tar(name) + if not is_whl_or_tar(name): + return False + + name = name.removesuffix(".tar.gz") + name = name.removesuffix(".whl") + + if name.endswith("wasm32"): + return False + + return True def get_release_for_tag(tag: str) -> dict[str, Any]: