Skip to content

Commit 56f8b38

Browse files
committed
Fix type handling
1 parent 4abb8ac commit 56f8b38

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/conftest.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
if TYPE_CHECKING:
5050
from typing import Protocol
5151

52-
from wsgi import WSGIApplication
52+
from _typeshed.wsgi import WSGIApplication
5353
else:
5454
# TODO: Protocol was introduced in Python 3.8. Remove this branch when
5555
# dropping support for Python 3.7.
@@ -645,7 +645,12 @@ def pip(self, *args: Union[str, Path]) -> InMemoryPipResult:
645645
try:
646646
returncode = pip_entry_point([os.fspath(a) for a in args])
647647
except SystemExit as e:
648-
returncode = e.code or 0
648+
if isinstance(e.code, int):
649+
returncode = e.code
650+
elif e.code:
651+
returncode = 1
652+
else:
653+
returncode = 0
649654
finally:
650655
sys.stdout = orig_stdout
651656
return InMemoryPipResult(returncode, stdout.getvalue())

0 commit comments

Comments
 (0)