From ac1f9159645d0c41a078824b57a604b66be06a9c Mon Sep 17 00:00:00 2001 From: TheBurchLog <5104941+TheBurchLog@users.noreply.github.com> Date: Thu, 19 Oct 2023 18:48:04 +0000 Subject: [PATCH] Black Formatting --- brewtils/decorators.py | 8 +++----- brewtils/rest/client.py | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/brewtils/decorators.py b/brewtils/decorators.py index 86799372..a0f7734a 100644 --- a/brewtils/decorators.py +++ b/brewtils/decorators.py @@ -474,9 +474,6 @@ def _initialize_command(method): cmd.name = _method_name(method) cmd.description = cmd.description or _method_docstring(method) - # if str(inspect.signature(method)._return_annotation) in ["", ""]: - # cmd.output_type = "JSON" - try: base_dir = os.path.dirname(inspect.getfile(method)) @@ -951,8 +948,9 @@ def _signature_validate(cmd, method): method, param.key ) and param.type != _parameter_type_hint(method, param.key): raise PluginParamError( - "Parameter Type assigned in the @parameter(type=?) does not match either the function Type Hint " - "or the Doc String definition. Please evaluate your type matching." + "Parameter Type assigned in the @parameter(type=?) does not match " + "either the function Type Hint or the Doc String definition. " + "Please evaluate your type matching." ) # Couldn't find the parameter. That's OK if this parameter is meant to be part diff --git a/brewtils/rest/client.py b/brewtils/rest/client.py index ffe14fac..bfd1de99 100644 --- a/brewtils/rest/client.py +++ b/brewtils/rest/client.py @@ -227,7 +227,7 @@ def can_connect(self, **kwargs): try: self.session.get(self.config_url, **kwargs) except requests.exceptions.ConnectionError as ex: - if type(ex) == requests.exceptions.ConnectionError: + if isinstance(ex, requests.exceptions.ConnectionError): return False raise @@ -831,7 +831,7 @@ def post_chunked_file(self, fd, file_params, current_position=0): data = fd.read(file_params["chunk_size"]) if not data: break - if type(data) != bytes: + if not isinstance(data, bytes): data = bytes(data, "utf-8") data = b64encode(data) chunk_result = self.session.post(