diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 26d9de46651..7949983043b 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -445,8 +445,7 @@ class _NormalAccessor(_Accessor): # Helper for resolve() if hasattr(os, "readlink"): - def readlink(self, path): - return os.readlink(path) + readlink = os.readlink else: def readlink(self, path): raise NotImplementedError("readlink() not available on this system")