From 92ca0e57afc4817af96cbc87e4d47e8d5bfef108 Mon Sep 17 00:00:00 2001 From: Robert de Vries Date: Mon, 18 May 2026 20:30:39 +0200 Subject: [PATCH] Remove redundant open modes. Redundant `open` mode arguments are unnecessary and should be removed to avoid confusion. --- scripts/build_ffi.py | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build_ffi.py b/scripts/build_ffi.py index ec170d5..b0b4f24 100644 --- a/scripts/build_ffi.py +++ b/scripts/build_ffi.py @@ -321,7 +321,7 @@ def get_features(local_wolfssl, features): "fips.h") if fips_file and os.path.exists(fips_file): - with open(fips_file, "r") as f: + with open(fips_file) as f: contents = f.read() if not contents.isspace(): fips = True @@ -347,7 +347,7 @@ def get_features(local_wolfssl, features): defines = [] for file in defines_files: - with open(file, 'r') as f: + with open(file) as f: defines += f.read().splitlines() features["MPAPI"] = 1 if '#define WOLFSSL_PUBLIC_MP' in defines else 0 diff --git a/setup.py b/setup.py index 805262c..6f687b5 100755 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ os.chdir(os.path.dirname(sys.argv[0]) or ".") VERSIONFILE = "wolfcrypt/_version.py" -verstrline = open(VERSIONFILE, "rt").read() +verstrline = open(VERSIONFILE).read() VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" mo = re.search(VSRE, verstrline, re.M) if mo: