diff options
Diffstat (limited to 'Lib/pathlib.py')
-rw-r--r-- | Lib/pathlib.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 0484dac..9f34721 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -1235,7 +1235,7 @@ class Path(PurePath): if not exist_ok or not self.is_dir(): raise except OSError as e: - if e.errno != ENOENT: + if e.errno != ENOENT or self.parent == self: raise self.parent.mkdir(parents=True) self._accessor.mkdir(self, mode) |