changeset 2285:0912f807b7ff

win98: fall back to win32api.GetModuleFileName if needed.
author Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
date Sun, 14 May 2006 23:49:31 -0700
parents d6392a7c03dd
children 9f745d3675d4
files mercurial/util_win32.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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():