Skip to content

Commit

Permalink
build_backend: Adjust type ignore for mypy 1.13.0
Browse files Browse the repository at this point in the history
The error name changed:

> No overload variant of "open" matches argument types "GzipFile", "str", "bool"  [call-overload]

So accept both the old and new spelling for the time being.
  • Loading branch information
martinpitt committed Dec 9, 2024
1 parent 76830d1 commit 7fb8d6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/build_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def build_sdist(sdist_directory: str,
# We do this manually to avoid adding timestamps. See https://bugs.python.org/issue31526
with gzip.GzipFile(f'{sdist_directory}/{sdist_filename}', mode='w', mtime=0) as gz:
# https://github.com/python/typeshed/issues/5491
with tarfile.open(fileobj=gz, mode='w|', dereference=True) as sdist: # type: ignore[arg-type]
with tarfile.open(fileobj=gz, mode='w|', dereference=True) as sdist: # type: ignore[arg-type,call-overload]
for filename in sorted(find_sources(srcpkg=True)):
sdist.add(filename, arcname=f'{PACKAGE}/{filename}', )
return sdist_filename
Expand Down

0 comments on commit 7fb8d6c

Please sign in to comment.