@@ -87,11 +87,11 @@ def find_nim_std_lib() -> Optional[Path]:
87
87
"""
88
88
# If Nim is not installed there's nothing to be done
89
89
if not shutil .which ('nim' ):
90
- return # type: ignore[return-value]
90
+ return # type: ignore[return-value]
91
91
92
92
# Installed via choosenim_install Pypi package
93
93
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]
95
95
try :
96
96
nim_ver = (subprocess .check_output (['nim' , '-v' ])
97
97
.decode (errors = 'ignore' )
@@ -113,7 +113,7 @@ def find_nim_std_lib() -> Optional[Path]:
113
113
)
114
114
115
115
(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]
117
117
stdlib = toolchain / 'lib'
118
118
119
119
if (stdlib / 'system.nim' ).exists ():
@@ -134,7 +134,7 @@ def find_nim_std_lib() -> Optional[Path]:
134
134
def copy_headers (build_dir_relative : Path ) -> Path :
135
135
"Can't compile without nimbase.h"
136
136
NIMBASE = 'nimbase.h'
137
- nimbase = find_nim_std_lib () / NIMBASE # type: ignore[operator]
137
+ nimbase = find_nim_std_lib () / NIMBASE # type: ignore[operator]
138
138
nimbase_dest = build_dir_relative / NIMBASE
139
139
shutil .copyfile (nimbase , nimbase_dest )
140
140
assert nimbase_dest .exists ()
@@ -278,7 +278,8 @@ def prevent_win32_max_path_length_error(path: Path) -> None:
278
278
279
279
def _is_valid_identifier (string : str ) -> bool :
280
280
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]
282
283
283
284
def _is_semver (string : str ) -> bool :
284
285
try :
0 commit comments