diff --git a/os/os/__init__.py b/os/os/__init__.py index 2a72bbf6..dec92677 100644 --- a/os/os/__init__.py +++ b/os/os/__init__.py @@ -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)