Skip to content

Commit 80b82b5

Browse files
committed
Address review comments
1 parent 3b98423 commit 80b82b5

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/pip/_internal/pep425tags.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
if MYPY_CHECK_RUNNING:
1818
from typing import (
19-
Tuple, Callable, List, Optional, Union, Dict
19+
Tuple, Callable, List, Optional, Union, Dict, Set
2020
)
2121

2222
Pep425Tag = Tuple[str, str, str]
@@ -311,7 +311,7 @@ def get_supported(
311311
if abi:
312312
abis[0:0] = [abi]
313313

314-
abi3s = set()
314+
abi3s = set() # type: Set[str]
315315
for suffix in get_extension_suffixes():
316316
if suffix.startswith('.abi'):
317317
abi3s.add(suffix.split('.', 2)[1])
@@ -354,7 +354,6 @@ def get_supported(
354354

355355
# Current version, current API (built specifically for our Python):
356356
for abi in abis:
357-
assert abi
358357
for arch in arches:
359358
supported.append(('%s%s' % (impl, versions[0]), abi, arch))
360359

@@ -364,7 +363,6 @@ def get_supported(
364363
if version in {'31', '30'}:
365364
break
366365
for abi in abi3s: # empty set if not Python 3
367-
assert abi
368366
for arch in arches:
369367
supported.append(("%s%s" % (impl, version), abi, arch))
370368

src/pip/_internal/utils/appdirs.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ def _get_win_folder_from_registry(csidl_name):
218218

219219
def _get_win_folder_with_ctypes(csidl_name):
220220
# type: (str) -> str
221+
# On Python 2, ctypes.create_unicode_buffer().value returns "unicode",
222+
# which isn't the same as str in the annotation above.
221223
csidl_const = {
222224
"CSIDL_APPDATA": 26,
223225
"CSIDL_COMMON_APPDATA": 35,
@@ -239,8 +241,7 @@ def _get_win_folder_with_ctypes(csidl_name):
239241
if ctypes.windll.kernel32.GetShortPathNameW(buf.value, buf2, 1024):
240242
buf = buf2
241243

242-
# On Python 2, ctypes.create_unicode_buffer().value returns "unicode",
243-
# which isn't the same as str in the annotation above.
244+
# The type: ignore is explained under the type annotation for this function
244245
return buf.value # type: ignore
245246

246247

0 commit comments

Comments
 (0)