os: Proactively filter all str/bytes variants of "."/"..".

pull/65/merge
Paul Sokolovsky 2015-12-24 00:35:57 +02:00
rodzic eb0981496a
commit f815a2a9f0
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -132,7 +132,7 @@ def listdir(path="."):
res = []
for dirent in ilistdir(path):
fname = dirent[0]
if fname != b"." and fname != b"..":
if fname not in (b".", b"..", ".", ".."):
if is_str:
fname = fsdecode(fname)
res.append(fname)