From dccfe9f19aa4c5df798b48c13f85e22b99bf643b Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 17 Mar 2024 13:32:24 +0000 Subject: [PATCH] Linting: resolve pylint R1732 suggestion --- pywisetransfer/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pywisetransfer/__init__.py b/pywisetransfer/__init__.py index 629760a..1e5e641 100644 --- a/pywisetransfer/__init__.py +++ b/pywisetransfer/__init__.py @@ -31,7 +31,8 @@ def __init__( raise ValueError( "Please provide only one of pywisetransfer.private_key_file or private_key_data" ) - private_key_data = open(private_key_file, "rb").read() + with open(private_key_file, "rb") as f: + private_key_data = f.read() self.api_key = api_key self.environment = environment