Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tweak import
  • Loading branch information
barneygale committed Aug 12, 2024
commit d646ad23c72cefcc8d78317a730c94351b64787e
8 changes: 4 additions & 4 deletions Lib/pathlib/_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
resemble pathlib's PurePath and Path respectively.
"""

import errno
import functools
import operator
import posixpath
from errno import EINVAL
from glob import _GlobberBase, _no_recurse_symlinks
from stat import S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK, S_ISBLK, S_ISCHR, S_ISFIFO
from pathlib._os import copyfileobj
Expand Down Expand Up @@ -574,7 +574,7 @@ def _ensure_different_file(self, other_path):
return
except (OSError, ValueError):
return
err = OSError(errno.EINVAL, "Source and target are the same file")
err = OSError(EINVAL, "Source and target are the same file")
err.filename = str(self)
err.filename2 = str(other_path)
raise err
Expand All @@ -584,9 +584,9 @@ def _ensure_distinct_path(self, other_path):
Raise OSError(EINVAL) if the other path is within this path.
"""
if self == other_path:
err = OSError(errno.EINVAL, "Source and target are the same path")
err = OSError(EINVAL, "Source and target are the same path")
elif self in other_path.parents:
err = OSError(errno.EINVAL, "Source path is a parent of target path")
err = OSError(EINVAL, "Source path is a parent of target path")
else:
return
err.filename = str(self)
Expand Down