Skip to content

Commit

Permalink
os.path.expanduser() is much cleaner than my home-made logic
Browse files Browse the repository at this point in the history
  • Loading branch information
adaptee committed Dec 4, 2010
1 parent 6977f91 commit 48dd34c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pinyin-comp
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,8 @@ def stringlize(text):
return text

def expand_leading_tilda(path):
"expand leading ~/ into $HOME"

if path and path[0] == '~':
home = os.environ['HOME']
return os.path.join( home, path[2:])
else:
return path
"expand leading ~/ or ~user/"
return os.path.expanduser(path)

if __name__ == '__main__':

Expand Down

0 comments on commit 48dd34c

Please sign in to comment.