diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -31,7 +31,7 @@ def loaddoc(topic): """Return a delayed loader for help/topic.txt.""" def loader(): - if hasattr(sys, 'frozen'): + if util.mainfrozen(): module = sys.executable else: module = __file__ diff --git a/mercurial/hook.py b/mercurial/hook.py --- a/mercurial/hook.py +++ b/mercurial/hook.py @@ -28,7 +28,7 @@ def _pythonhook(ui, repo, name, hname, f 'a module)') % (hname, funcname)) modname = funcname[:d] oldpaths = sys.path - if hasattr(sys, "frozen"): + if util.mainfrozen(): # binary installs require sys.path manipulation modpath, modfile = os.path.split(modname) if modpath and modfile: diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -341,7 +341,7 @@ def templatepath(name=None): normpaths = [] # executable version (py2exe) doesn't support __file__ - if hasattr(sys, 'frozen'): + if util.mainfrozen(): module = sys.executable else: module = __file__