changeset 12966:5f80f44d23c5 stable

win32: remove try-catch block of GetModuleFileNameEx (issue2480) According to the API document, GetModuleFileName is the preferred way to retrieve the filename of the current process. So we shouldn't try GetModuleFileName'Ex' first. Previously system_rcpath_win32() happened to return unicode paths due to GetModuleFileNameEx (issue2480). This problem is fixed as GetModuleFileName never return unicode.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 11 Nov 2010 01:12:51 +0900
parents 0d4fb319974b
children 70b043405400
files mercurial/win32.py
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/win32.py	Tue Nov 09 20:25:56 2010 +0000
+++ b/mercurial/win32.py	Thu Nov 11 01:12:51 2010 +0900
@@ -102,12 +102,7 @@
 
 def system_rcpath_win32():
     '''return default os-specific hgrc search path'''
-    proc = win32api.GetCurrentProcess()
-    try:
-        # This will fail on windows < NT
-        filename = win32process.GetModuleFileNameEx(proc, 0)
-    except:
-        filename = win32api.GetModuleFileName(0)
+    filename = win32api.GetModuleFileName(0)
     # Use mercurial.ini found in directory with hg.exe
     progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini')
     if os.path.isfile(progrc):