##// END OF EJS Templates
only check listdir on dirs...
MinRK -
Show More
@@ -102,10 +102,12 b" def is_hidden(abs_path, abs_root=''):"
102 102 if any(part.startswith('.') for part in inside_root.split(os.sep)):
103 103 return True
104 104
105 # check that path can be listed
105 # check that dirs can be listed
106 # may fail on Windows junctions or non-user-readable dirs
107 if os.path.isdir(abs_path):
106 108 try:
107 109 os.listdir(abs_path)
108 except Exception:
110 except OSError:
109 111 return True
110 112
111 113 # check UF_HIDDEN on any location up to root
@@ -114,7 +116,7 b" def is_hidden(abs_path, abs_root=''):"
114 116 try:
115 117 # may fail on Windows junctions
116 118 st = os.stat(path)
117 except Exception:
119 except OSError:
118 120 return True
119 121 if getattr(st, 'st_flags', 0) & UF_HIDDEN:
120 122 return True
General Comments 0
You need to be logged in to leave comments. Login now