diff -r db15bb2d6323 -r 92b54547ac5d mercurial/util.py --- a/mercurial/util.py Sun Sep 28 16:57:06 2014 +0200 +++ b/mercurial/util.py Sun Sep 28 16:57:06 2014 +0200 @@ -460,6 +460,13 @@ safehasattr(sys, "importers") or # old py2exe imp.is_frozen("__main__")) # tools/freeze +# the location of data files matching the source code +if mainfrozen(): + # executable version (py2exe) doesn't support __file__ + datapath = os.path.dirname(sys.executable) +else: + datapath = os.path.dirname(__file__) + _hgexecutable = None def hgexecutable():