Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: gcl.py

Issue 1471973004: Fix some path processing to work better on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: lint Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cit.py ('k') | gerrit_util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
diff --git a/gcl.py b/gcl.py
index bd8531250d6bac6bf68cf2af4c4d296c9d78a5b6..1f88025dda916ab8309550fe890107e95e953d57 100755
--- a/gcl.py
+++ b/gcl.py
@@ -71,15 +71,9 @@ def CheckHomeForFile(filename):
"""Checks the users home dir for the existence of the given file. Returns
the path to the file if it's there, or None if it is not.
"""
- home_vars = ['HOME']
- if sys.platform in ('cygwin', 'win32'):
- home_vars.append('USERPROFILE')
- for home_var in home_vars:
- home = os.getenv(home_var)
- if home != None:
- full_path = os.path.join(home, filename)
- if os.path.exists(full_path):
- return full_path
+ full_path = os.path.expanduser(os.path.join('~', filename))
+ if os.path.exists(full_path):
+ return full_path
return None
« no previous file with comments | « cit.py ('k') | gerrit_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698