Skip to content

Commit

Permalink
Undo unnecessary change
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Jul 22, 2024
1 parent a5ee60a commit f9219ee
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Lib/test/test_pathlib/test_pathlib_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1536,14 +1536,13 @@ def unlink(self, missing_ok=False):
elif not missing_ok:
raise FileNotFoundError(errno.ENOENT, "File not found", path)

def rmdir(self, missing_ok=False):
def rmdir(self):
path_obj = self.parent.resolve(strict=True) / self.name
path = str(path_obj)
if path in self._files or path in self._symlinks:
raise NotADirectoryError(errno.ENOTDIR, "Not a directory", path)
elif path not in self._directories:
if not missing_ok:
raise FileNotFoundError(errno.ENOENT, "File not found", path)
raise FileNotFoundError(errno.ENOENT, "File not found", path)
elif self._directories[path]:
raise OSError(errno.ENOTEMPTY, "Directory not empty", path)
else:
Expand Down

0 comments on commit f9219ee

Please sign in to comment.