From b96c6e2096c387b70e2a4c1f0bc53b6044a0dc6f Mon Sep 17 00:00:00 2001 From: Matthias Baumgartner Date: Fri, 25 Nov 2022 14:36:27 +0100 Subject: decouple readers and extractors; use strings for reference and repeated type annotations --- bsie/reader/stat.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'bsie/reader/stat.py') diff --git a/bsie/reader/stat.py b/bsie/reader/stat.py index f0b83fb..6d40ab8 100644 --- a/bsie/reader/stat.py +++ b/bsie/reader/stat.py @@ -8,7 +8,7 @@ Author: Matthias Baumgartner, 2022 import os import typing -# inner-module imports +# bsie imports from bsie.base import reader, errors # exports @@ -22,9 +22,7 @@ __all__: typing.Sequence[str] = ( class Stat(reader.Reader): """Read and return the filesystem's stat infos.""" - CONTENT_TYPE = typing.Union[os.stat_result] - - def __call__(self, path: str) -> CONTENT_TYPE: + def __call__(self, path: str) -> os.stat_result: try: return os.stat(path) except Exception: -- cgit v1.2.3 From c9a1dea230054f5d6f40b7fd5e3930609c5f6416 Mon Sep 17 00:00:00 2001 From: Matthias Baumgartner Date: Fri, 25 Nov 2022 14:41:38 +0100 Subject: code analysis tool configs and minor fixes --- bsie/reader/stat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bsie/reader/stat.py') diff --git a/bsie/reader/stat.py b/bsie/reader/stat.py index 6d40ab8..592d912 100644 --- a/bsie/reader/stat.py +++ b/bsie/reader/stat.py @@ -25,8 +25,8 @@ class Stat(reader.Reader): def __call__(self, path: str) -> os.stat_result: try: return os.stat(path) - except Exception: - raise errors.ReaderError(path) + except Exception as err: + raise errors.ReaderError(path) from err ## EOF ## -- cgit v1.2.3