diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py +++ b/mercurial/utils/procutil.py @@ -537,9 +537,13 @@ # continue the hg process here. os._exit(returncode) +def executablerelativeresources(): + """Whether data/resource files are relative to the current executable.""" + return mainfrozen() and getattr(sys, 'frozen', None) != 'macosx_app' + def datapath(): """Return location of data/resource files that are part of the source.""" - if mainfrozen() and getattr(sys, 'frozen', None) != 'macosx_app': + if executablerelativeresources(): # executable version (py2exe) doesn't support __file__ return os.path.dirname(pycompat.sysexecutable) else: