Skip to content

Commit

Permalink
Fix str presentation of expanded path #923 #915
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Peng committed Mar 15, 2018
1 parent 050d3a5 commit ec11785
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sos/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,11 @@ class path(type(Path())):

def _init(self, template=None):
super(path, self)._init(template)
if self._parts and self._parts[0] == '~':
self._parts = self.expanduser()._parts
if not (self._drv or self._root) and self._parts and self._parts[0][:1] == '~':
expanded = self.expanduser()
self._parts = expanded._parts
self._drv = expanded._drv
self._root = expanded._root

def is_external(self):
try:
Expand Down

0 comments on commit ec11785

Please sign in to comment.