Skip to content

Commit 28c8cbd

Browse files
committed
Fix exception types, undo rename
1 parent 9a7c9a2 commit 28c8cbd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/pathlib/_os.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def copy_info(info, target, follow_symlinks=True):
363363
raise
364364

365365

366-
class _LocalPathInfo:
366+
class _PathInfoBase:
367367
__slots__ = ('_path',)
368368

369369
def __init__(self, path):
@@ -416,7 +416,7 @@ def _xattrs(self, *, follow_symlinks=True):
416416
_STAT_RESULT_ERROR = [] # falsy sentinel indicating stat() failed.
417417

418418

419-
class StatResultInfo(_LocalPathInfo):
419+
class StatResultInfo(_PathInfoBase):
420420
"""Implementation of pathlib.types.PathInfo that provides status
421421
information by querying a wrapped os.stat_result object. Don't try to
422422
construct it yourself."""
@@ -499,7 +499,7 @@ def is_symlink(self):
499499
return S_ISLNK(st.st_mode)
500500

501501

502-
class DirEntryInfo(_LocalPathInfo):
502+
class DirEntryInfo(_PathInfoBase):
503503
"""Implementation of pathlib.types.PathInfo that provides status
504504
information by querying a wrapped os.DirEntry object. Don't try to
505505
construct it yourself."""
@@ -519,7 +519,7 @@ def exists(self, *, follow_symlinks=True):
519519
return True
520520
try:
521521
self._stat(follow_symlinks=follow_symlinks)
522-
except (OSError, ValueError):
522+
except OSError:
523523
return False
524524
return True
525525

0 commit comments

Comments
 (0)