diff options
author | Helmut Grohne <helmut@subdivi.de> | 2025-06-26 18:09:48 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2025-06-26 18:09:48 +0200 |
commit | 90d6df82a71ac899a92197090c05f9aedc2f5786 (patch) | |
tree | a5d6b7930a5c15d1cad85ab4ae2eea759f4b5cde /linuxnamespaces/atlocation.py | |
parent | 2b00e2d17042eba9c08a879db5842b98311ac4ef (diff) | |
download | python-linuxnamespaces-90d6df82a71ac899a92197090c05f9aedc2f5786.tar.gz |
simplify or-ed isinstance invocations
Suggested-by: pylint
Diffstat (limited to 'linuxnamespaces/atlocation.py')
-rw-r--r-- | linuxnamespaces/atlocation.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linuxnamespaces/atlocation.py b/linuxnamespaces/atlocation.py index 0e2be87..46ac541 100644 --- a/linuxnamespaces/atlocation.py +++ b/linuxnamespaces/atlocation.py @@ -78,7 +78,7 @@ class AtLocation: return thing # Don't copy. obj = super(AtLocation, cls).__new__(cls) if not isinstance(thing, FileDescriptor): - if isinstance(thing, int) or isinstance(thing, HasFileno): + if isinstance(thing, (int, HasFileno)): thing = FileDescriptor(thing) if isinstance(thing, FileDescriptor): if thing < 0 and thing != AT_FDCWD: @@ -150,7 +150,7 @@ class AtLocation: them with a slash as separator. The returned AtLocation borrows its fd if any. """ - if isinstance(other, int) or isinstance(other, HasFileno): + if isinstance(other, (int, HasFileno)): # A an fd is considered an absolute AT_EMPTY_PATH path. return AtLocation(other) non_empty_flags = self.flags & ~AtFlags.AT_EMPTY_PATH |