From 71025dff17e588df2eb55413da8954449dc3c6fc Mon Sep 17 00:00:00 2001 From: Vladimir Iakovlev Date: Sun, 14 Aug 2016 15:32:53 +0300 Subject: [PATCH] #N/A: Monkeypatch old pathlib even on unix --- thefuck/system/unix.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/thefuck/system/unix.py b/thefuck/system/unix.py index cc6ff570..ca878033 100644 --- a/thefuck/system/unix.py +++ b/thefuck/system/unix.py @@ -1,3 +1,4 @@ +import os import sys import tty import termios @@ -38,3 +39,10 @@ try: from pathlib import Path except ImportError: from pathlib2 import Path + + +def _expanduser(self): + return self.__class__(os.path.expanduser(str(self))) + +if not hasattr(Path, 'expanduser'): + Path.expanduser = _expanduser