diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f1111c..a656f4d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -14,6 +14,6 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 24.1.1 hooks: - id: black diff --git a/src/lecroyscope/reading/file.py b/src/lecroyscope/reading/file.py index 520c10c..2737342 100644 --- a/src/lecroyscope/reading/file.py +++ b/src/lecroyscope/reading/file.py @@ -13,9 +13,11 @@ def read( filename_or_bytes: str | PathLike[str] | bytes, header_only: bool = False ) -> tuple[dict[str, str | int | float], numpy.ndarray, numpy.ndarray]: - with open(filename_or_bytes, "r+b") if not isinstance( - filename_or_bytes, bytes - ) else BytesIO(filename_or_bytes) as f: + with ( + open(filename_or_bytes, "r+b") + if not isinstance(filename_or_bytes, bytes) + else BytesIO(filename_or_bytes) + ) as f: wavedesc_bytes = b"WAVEDESC" # find "WAVEDESC" and skip those bytes if isinstance(filename_or_bytes, bytes):