From eb24ea2e8bd56584606eea718f02acd00f3f9962 Mon Sep 17 00:00:00 2001 From: hackermd Date: Wed, 23 Sep 2020 08:51:23 -0400 Subject: [PATCH] Fix further typing errors --- src/dicomweb_client/api.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dicomweb_client/api.py b/src/dicomweb_client/api.py index 65cf850..e32b8c3 100644 --- a/src/dicomweb_client/api.py +++ b/src/dicomweb_client/api.py @@ -744,7 +744,7 @@ def _decode_multipart_message( if stream: iterator = response.iter_content(chunk_size=self._chunk_size) else: - iterator = [response.content] + iterator = iter([response.content]) for i, chunk in enumerate(iterator): if stream: logger.debug(f'decode message content chunk #{i}') @@ -965,8 +965,8 @@ def _build_multipart_accept_header_field_value( ] if expected_media_type != media_type: have_same_type = ( - self._parse_media_type(media_type)[0] == - self._parse_media_type(expected_media_type)[0] + cls._parse_media_type(media_type)[0] == + cls._parse_media_type(expected_media_type)[0] ) if (have_same_type and (media_type.endswith('/*') or @@ -1712,6 +1712,7 @@ def _get_common_media_type( return common_media_types[0] def _get_bulkdata( + self, url: str, media_types: Optional[Tuple[Union[str, Tuple[str, str]]]] = None, byte_range: Optional[Tuple[int, int]] = None, @@ -2715,7 +2716,7 @@ def _get_instance_frames( ) else: raise ValueError( - f'Media type "{common_media_types}" is not supported for ' + f'Media type "{common_media_type}" is not supported for ' 'retrieval of frames.' )