diff options
Diffstat (limited to 'Lib/pathlib.py')
| -rw-r--r-- | Lib/pathlib.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py index f0537cfea1..7d1d1150b0 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -418,7 +418,12 @@ class _NormalAccessor(_Accessor): unlink = os.unlink - link_to = os.link + if hasattr(os, "link"): + link_to = os.link + else: + @staticmethod + def link_to(self, target): + raise NotImplementedError("os.link() not available on this system") rmdir = os.rmdir |
