Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util_win32.py @ 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 | a600d9997521 |
comparison
equal
deleted
inserted
replaced
2284:d6392a7c03dd | 2285:0912f807b7ff |
---|---|
178 return True | 178 return True |
179 | 179 |
180 def system_rcpath_win32(): | 180 def system_rcpath_win32(): |
181 '''return default os-specific hgrc search path''' | 181 '''return default os-specific hgrc search path''' |
182 proc = win32api.GetCurrentProcess() | 182 proc = win32api.GetCurrentProcess() |
183 filename = win32process.GetModuleFileNameEx(proc, 0) | 183 try: |
184 # This will fail on windows < NT | |
185 filename = win32process.GetModuleFileNameEx(proc, 0) | |
186 except: | |
187 filename = win32api.GetModuleFileName(0) | |
184 return [os.path.join(os.path.dirname(filename), 'mercurial.ini')] | 188 return [os.path.join(os.path.dirname(filename), 'mercurial.ini')] |
185 | 189 |
186 def user_rcpath(): | 190 def user_rcpath(): |
187 '''return os-specific hgrc search path to the user dir''' | 191 '''return os-specific hgrc search path to the user dir''' |
188 userdir = os.path.expanduser('~') | 192 userdir = os.path.expanduser('~') |