Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser)
(self)
| 1375 | return False |
| 1376 | |
| 1377 | def expanduser(self): |
| 1378 | """ Return a new path with expanded ~ and ~user constructs |
| 1379 | (as returned by os.path.expanduser) |
| 1380 | """ |
| 1381 | if (not (self._drv or self._root) and |
| 1382 | self._parts and self._parts[0][:1] == '~'): |
| 1383 | homedir = os.path.expanduser(self._parts[0]) |
| 1384 | if homedir[:1] == "~": |
| 1385 | raise RuntimeError("Could not determine home directory.") |
| 1386 | return self._from_parts([homedir] + self._parts[1:]) |
| 1387 | |
| 1388 | return self |
| 1389 | |
| 1390 | |
| 1391 | class PosixPath(Path, PurePosixPath): |
no test coverage detected