diff options
author | Helmut Grohne <helmut@subdivi.de> | 2024-02-21 10:15:26 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2024-02-21 10:15:26 +0100 |
commit | b64313d313723c62f173f750f2d699ebf169e01f (patch) | |
tree | 8af862901d1139368b3a6bac7d4bc01d27a1efe5 /linuxnamespaces/__init__.py | |
parent | 12f32219ff6a7e0eef6b914589d47066480404de (diff) | |
download | python-linuxnamespaces-b64313d313723c62f173f750f2d699ebf169e01f.tar.gz |
revoke the false promise that bytes would be convertible to Path
pathlib.Path(somebytes) fails. Hence bytes is not actually convertible
and should not be included in PathConvertible. Then, we can simplify
matters in quite a few places by knowing that the thing we work with is
not bytes.
Diffstat (limited to 'linuxnamespaces/__init__.py')
-rw-r--r-- | linuxnamespaces/__init__.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/linuxnamespaces/__init__.py b/linuxnamespaces/__init__.py index c060e01..f2e54ce 100644 --- a/linuxnamespaces/__init__.py +++ b/linuxnamespaces/__init__.py @@ -246,11 +246,8 @@ def bind_mount( source = AtLocation(source) target = AtLocation(target) try: - # mypy does not know that os.fspath accepts AtLocation - srcloc: str | bytes - srcloc = os.fspath(source) # type: ignore - tgtloc: str | bytes - tgtloc = os.fspath(target) # type: ignore + srcloc = os.fspath(source) + tgtloc = os.fspath(target) except ValueError: otflags = OpenTreeFlags.OPEN_TREE_CLONE if recursive: |