Skip to content

Commit 9a62dd3

Browse files
committed
Fix type hints
1 parent e463667 commit 9a62dd3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

nimporter/nexporter.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ def find_nim_std_lib() -> Optional[Path]:
8787
"""
8888
# If Nim is not installed there's nothing to be done
8989
if not shutil.which('nim'):
90-
return # type: ignore[return-value]
90+
return # type: ignore[return-value]
9191

9292
# Installed via choosenim_install Pypi package
9393
choosenim_dir = Path('~/.choosenim/toolchains').expanduser().absolute()
94-
if choosenim_dir.exists: # type: ignore[truthy-function]
94+
if choosenim_dir.exists: # type: ignore[truthy-function]
9595
try:
9696
nim_ver = (subprocess.check_output(['nim', '-v'])
9797
.decode(errors='ignore')
@@ -113,7 +113,7 @@ def find_nim_std_lib() -> Optional[Path]:
113113
)
114114

115115
(choosenim,) = [i for i in o.splitlines() if 'Path:' in i]
116-
toolchain = Path(choosenim.split('Path:').pop().strip()) # type: ignore[arg-type]
116+
toolchain = Path(choosenim.split('Path:').pop().strip()) # type: ignore[arg-type]
117117
stdlib = toolchain / 'lib'
118118

119119
if (stdlib / 'system.nim').exists():
@@ -134,7 +134,7 @@ def find_nim_std_lib() -> Optional[Path]:
134134
def copy_headers(build_dir_relative: Path) -> Path:
135135
"Can't compile without nimbase.h"
136136
NIMBASE = 'nimbase.h'
137-
nimbase = find_nim_std_lib() / NIMBASE # type: ignore[operator]
137+
nimbase = find_nim_std_lib() / NIMBASE # type: ignore[operator]
138138
nimbase_dest = build_dir_relative / NIMBASE
139139
shutil.copyfile(nimbase, nimbase_dest)
140140
assert nimbase_dest.exists()
@@ -278,7 +278,8 @@ def prevent_win32_max_path_length_error(path: Path) -> None:
278278

279279
def _is_valid_identifier(string: str) -> bool:
280280
match = re.search('^[A-Za-z_][A-Z-a-z0-9_\\-]*', string)
281-
return match and len(match.string) == len(string)
281+
result = match and len(match.string) == len(string)
282+
return result # type: ignore[return-value]
282283

283284
def _is_semver(string: str) -> bool:
284285
try:

0 commit comments

Comments
 (0)