From f8b1a2e565b055d90f15b2a6d7aa16031eb4e1f0 Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Fri, 6 May 2016 11:24:28 +0100 Subject: [PATCH] Remove unnecessary equality check - Remove unnecessary equality check and wrap the value in `bool`. - Remove unnecessary `bool` wrapping. --- beets/util/hidden.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beets/util/hidden.py b/beets/util/hidden.py index 101e8c2d1..262d371ea 100644 --- a/beets/util/hidden.py +++ b/beets/util/hidden.py @@ -30,7 +30,7 @@ def _is_hidden_osx(path): file_stat = os.lstat(path) if hasattr(file_stat, 'st_flags') and hasattr(stat, 'UF_HIDDEN'): - return (file_stat.st_flags & stat.UF_HIDDEN) == stat.UF_HIDDEN + return bool(file_stat.st_flags & stat.UF_HIDDEN) else: return False @@ -48,7 +48,7 @@ def _is_hidden_win(path): attrs = ctypes.windll.kernel32.GetFileAttributesW(path) # Ensure we have valid attribues and compare them against the mask. - return attrs >= 0 and bool(attrs & hidden_mask) + return attrs >= 0 and attrs & hidden_mask def _is_hidden_dot(path):