Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util_win32.py @ 7427:f21e3d0e335b
util_win32: fix Windows version checking (issue1358)
shell.SHGetPathFromIDList() segfaults when called in Apache.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Wed, 26 Nov 2008 22:27:37 +0100 |
parents | 0d1c770c6be1 |
children | 5185a24ce04e |
comparison
equal
deleted
inserted
replaced
7421:4c4324476be6 | 7427:f21e3d0e335b |
---|---|
243 return [] | 243 return [] |
244 | 244 |
245 def user_rcpath_win32(): | 245 def user_rcpath_win32(): |
246 '''return os-specific hgrc search path to the user dir''' | 246 '''return os-specific hgrc search path to the user dir''' |
247 userdir = os.path.expanduser('~') | 247 userdir = os.path.expanduser('~') |
248 if sys.getwindowsversion() != 2 and userdir == '~': | 248 if sys.getwindowsversion()[3] != 2 and userdir == '~': |
249 # We are on win < nt: fetch the APPDATA directory location and use | 249 # We are on win < nt: fetch the APPDATA directory location and use |
250 # the parent directory as the user home dir. | 250 # the parent directory as the user home dir. |
251 appdir = shell.SHGetPathFromIDList( | 251 appdir = shell.SHGetPathFromIDList( |
252 shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_APPDATA)) | 252 shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_APPDATA)) |
253 userdir = os.path.dirname(appdir) | 253 userdir = os.path.dirname(appdir) |