From d646ad23c72cefcc8d78317a730c94351b64787e Mon Sep 17 00:00:00 2001 From: barneygale Date: Mon, 12 Aug 2024 13:37:12 +0100 Subject: [PATCH] Tweak import --- Lib/pathlib/_abc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/pathlib/_abc.py b/Lib/pathlib/_abc.py index e835351ca2a10e..262f323b442889 100644 --- a/Lib/pathlib/_abc.py +++ b/Lib/pathlib/_abc.py @@ -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 @@ -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 @@ -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)