diff options
author | andrei kulakov <andrei.avk@gmail.com> | 2021-12-30 07:45:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-30 07:45:06 (GMT) |
commit | 8d7644fa64213207b8dc6f555cb8a02bfabeced2 (patch) | |
tree | 2c2aa283dadd562a9c8f30de19f6266f6a23690f /Lib/pathlib.py | |
parent | fb44d0589615590b1e7895ba78a038e96b15a219 (diff) | |
download | cpython-8d7644fa64213207b8dc6f555cb8a02bfabeced2.zip cpython-8d7644fa64213207b8dc6f555cb8a02bfabeced2.tar.gz cpython-8d7644fa64213207b8dc6f555cb8a02bfabeced2.tar.bz2 |
bpo-45853: Fix misspelling and unused import in pathlib (GH-30292)
Diffstat (limited to 'Lib/pathlib.py')
-rw-r--r-- | Lib/pathlib.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 621fba0..f1a3317 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -8,7 +8,7 @@ import re import sys import warnings from _collections_abc import Sequence -from errno import EINVAL, ENOENT, ENOTDIR, EBADF, ELOOP +from errno import ENOENT, ENOTDIR, EBADF, ELOOP from operator import attrgetter from stat import S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK, S_ISBLK, S_ISCHR, S_ISFIFO from urllib.parse import quote_from_bytes as urlquote_from_bytes @@ -28,7 +28,7 @@ _WINERROR_INVALID_NAME = 123 # fix for bpo-35306 _WINERROR_CANT_RESOLVE_FILENAME = 1921 # broken symlink pointing to itself # EBADF - guard against macOS `stat` throwing EBADF -_IGNORED_ERROS = (ENOENT, ENOTDIR, EBADF, ELOOP) +_IGNORED_ERRNOS = (ENOENT, ENOTDIR, EBADF, ELOOP) _IGNORED_WINERRORS = ( _WINERROR_NOT_READY, @@ -36,7 +36,7 @@ _IGNORED_WINERRORS = ( _WINERROR_CANT_RESOLVE_FILENAME) def _ignore_error(exception): - return (getattr(exception, 'errno', None) in _IGNORED_ERROS or + return (getattr(exception, 'errno', None) in _IGNORED_ERRNOS or getattr(exception, 'winerror', None) in _IGNORED_WINERRORS) |