From 90d6df82a71ac899a92197090c05f9aedc2f5786 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 26 Jun 2025 18:09:48 +0200 Subject: simplify or-ed isinstance invocations Suggested-by: pylint --- linuxnamespaces/atlocation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linuxnamespaces') 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 -- cgit v1.2.3