diff --git a/httpie/core.py b/httpie/core.py index d0c26dcbcc..ca2cd14170 100644 --- a/httpie/core.py +++ b/httpie/core.py @@ -293,6 +293,6 @@ def decode_raw_args( """ return [ arg.decode(stdin_encoding) - if type(arg) is bytes else arg + if isinstance(arg, bytes) else arg for arg in args ] diff --git a/httpie/sessions.py b/httpie/sessions.py index 99dcdba92e..fddd35c2d2 100644 --- a/httpie/sessions.py +++ b/httpie/sessions.py @@ -204,7 +204,7 @@ def _compute_new_headers(self, request_headers: HTTPHeadersDict) -> HTTPHeadersD continue # Ignore explicitly unset headers original_value = value - if type(value) is not str: + if not isinstance(value, str): value = value.decode() if name.lower() == 'user-agent' and value.startswith('HTTPie/'):