aboutsummaryrefslogtreecommitdiffstats
path: root/bsie/reader
diff options
context:
space:
mode:
Diffstat (limited to 'bsie/reader')
-rw-r--r--bsie/reader/path.py7
-rw-r--r--bsie/reader/stat.py10
2 files changed, 6 insertions, 11 deletions
diff --git a/bsie/reader/path.py b/bsie/reader/path.py
index d27c664..d60f187 100644
--- a/bsie/reader/path.py
+++ b/bsie/reader/path.py
@@ -5,10 +5,9 @@ A copy of the license is provided with the project.
Author: Matthias Baumgartner, 2022
"""
# imports
-import os
import typing
-# inner-module imports
+# bsie imports
from bsie.base import reader
# exports
@@ -22,9 +21,7 @@ __all__: typing.Sequence[str] = (
class Path(reader.Reader):
"""Return the path."""
- CONTENT_TYPE = typing.Union[str]
-
- def __call__(self, path: str) -> CONTENT_TYPE:
+ def __call__(self, path: str) -> str:
return path
diff --git a/bsie/reader/stat.py b/bsie/reader/stat.py
index f0b83fb..592d912 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,13 +22,11 @@ __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:
- raise errors.ReaderError(path)
+ except Exception as err:
+ raise errors.ReaderError(path) from err
## EOF ##