win98: fall back to win32api.GetModuleFileName if needed.
authorVolker Kleinfeld <Volker.Kleinfeld@gmx.de>
Sun, 14 May 2006 23:49:31 -0700
changeset 2285 0912f807b7ff
parent 2284 d6392a7c03dd
child 2286 9f745d3675d4
win98: fall back to win32api.GetModuleFileName if needed.
mercurial/util_win32.py
--- a/mercurial/util_win32.py	Sun May 14 23:44:50 2006 -0700
+++ b/mercurial/util_win32.py	Sun May 14 23:49:31 2006 -0700
@@ -180,7 +180,11 @@
 def system_rcpath_win32():
     '''return default os-specific hgrc search path'''
     proc = win32api.GetCurrentProcess()
-    filename = win32process.GetModuleFileNameEx(proc, 0)
+    try:
+        # This will fail on windows < NT
+        filename = win32process.GetModuleFileNameEx(proc, 0)
+    except:
+        filename = win32api.GetModuleFileName(0)
     return [os.path.join(os.path.dirname(filename), 'mercurial.ini')]
 
 def user_rcpath():