# HG changeset patch # User Augie Fackler # Date 1311628442 18000 # Node ID 4a28cb4df1f870d5218a58d6434c51fef8b678b4 # Parent b4c06b97dfe0cae28497bc3ab85c075a173de8e6 windows: check util.mainfrozen() instead of ad-hoc checks everywhere diff -r b4c06b97dfe0 -r 4a28cb4df1f8 mercurial/help.py --- a/mercurial/help.py Mon Jul 25 22:19:28 2011 +0300 +++ b/mercurial/help.py Mon Jul 25 16:14:02 2011 -0500 @@ -31,7 +31,7 @@ """Return a delayed loader for help/topic.txt.""" def loader(): - if hasattr(sys, 'frozen'): + if util.mainfrozen(): module = sys.executable else: module = __file__ diff -r b4c06b97dfe0 -r 4a28cb4df1f8 mercurial/hook.py --- a/mercurial/hook.py Mon Jul 25 22:19:28 2011 +0300 +++ b/mercurial/hook.py Mon Jul 25 16:14:02 2011 -0500 @@ -28,7 +28,7 @@ '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 -r b4c06b97dfe0 -r 4a28cb4df1f8 mercurial/templater.py --- a/mercurial/templater.py Mon Jul 25 22:19:28 2011 +0300 +++ b/mercurial/templater.py Mon Jul 25 16:14:02 2011 -0500 @@ -341,7 +341,7 @@ normpaths = [] # executable version (py2exe) doesn't support __file__ - if hasattr(sys, 'frozen'): + if util.mainfrozen(): module = sys.executable else: module = __file__