Skip to content

Commit 9202ed9

Browse files
author
xy
committed
minor optimisation
1 parent b1ebe81 commit 9202ed9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/core.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@
5454

5555
windows = bool(os_name=='nt')
5656

57-
def is_hidden(filepath):
58-
if windows:
59-
return bool(stat(filepath).st_file_attributes & stat_FILE_ATTRIBUTE_HIDDEN)
60-
else:
61-
return basename(abspath(filepath)).startswith('.')
57+
def is_hidden_win(filepath):
58+
return bool(stat(filepath).st_file_attributes & stat_FILE_ATTRIBUTE_HIDDEN)
59+
60+
def is_hidden_lin(filepath):
61+
return basename(abspath(filepath)).startswith('.')
62+
63+
is_hidden = is_hidden_win if windows else is_hidden_lin
6264

6365
if windows:
6466
from subprocess import CREATE_NO_WINDOW

0 commit comments

Comments
 (0)