Sleek — mobile freeq client (Vidya + freeq-sdk)
Something went wrong. Try again.
509 B · 18 lines
Python
at main
12345678910111213141516171819"""Backport pathlib's Python 3.12 walk_up argument for Buck's C shim."""
import osimport pathlib
try: pathlib.PurePath(".").relative_to(".", walk_up=True)except TypeError: _relative_to = pathlib.PurePath.relative_to
def relative_to(self, *other, walk_up=False): if not walk_up: return _relative_to(self, *other) target = self.__class__(*other) return self.__class__(os.path.relpath(str(self), str(target)))
pathlib.PurePath.relative_to = relative_to