Skip to content

Commit

Permalink
Merge pull request #2223 from RTXteam/issue-2222
Browse files Browse the repository at this point in the history
  • Loading branch information
saramsey authored Dec 1, 2023
2 parents 69e100c + 1512bdb commit 4c776b4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import signal
import sys
import traceback
from typing import Union

from openapi_server import util
from typing import Iterator, TextIO, Any
Expand All @@ -28,7 +29,7 @@ def child_receive_sigpipe(signal_number, frame):
os._exit(0)


def _get_response(response_id: str) -> dict:
def _get_response(response_id: str) -> Union[dict, tuple]:
response_cache = ResponseCache()
return response_cache.get_response(response_id)

Expand Down Expand Up @@ -93,6 +94,8 @@ def get_response(response_id: str) -> Any: # noqa: E501
if do_fork:
read_fo = get_response_in_child_process(response_id)
resp_obj = json.load(read_fo)
if type(resp_obj) == list and len(resp_obj) == 2:
resp_obj = tuple(resp_obj)
else:
resp_obj = _get_response(response_id)
return resp_obj
Expand Down

0 comments on commit 4c776b4

Please sign in to comment.