mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-109413: libregrtest: enable mypy's --strict-optional
check on most files (#112586)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
5f6ac2d88a
commit
70a38ffb3d
4 changed files with 16 additions and 5 deletions
|
@ -377,10 +377,19 @@ def get_temp_dir(tmp_dir: StrPath | None = None) -> StrPath:
|
|||
# Python out of the source tree, especially when the
|
||||
# source tree is read only.
|
||||
tmp_dir = sysconfig.get_config_var('srcdir')
|
||||
if not tmp_dir:
|
||||
raise RuntimeError(
|
||||
"Could not determine the correct value for tmp_dir"
|
||||
)
|
||||
tmp_dir = os.path.join(tmp_dir, 'build')
|
||||
else:
|
||||
# WASI platform
|
||||
tmp_dir = sysconfig.get_config_var('projectbase')
|
||||
if not tmp_dir:
|
||||
raise RuntimeError(
|
||||
"sysconfig.get_config_var('projectbase') "
|
||||
f"unexpectedly returned {tmp_dir!r} on WASI"
|
||||
)
|
||||
tmp_dir = os.path.join(tmp_dir, 'build')
|
||||
|
||||
# When get_temp_dir() is called in a worker process,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue