# HG changeset patch # User Shun-ichi GOTO # Date 1142401144 -3600 # Node ID 2f500a4b6e994419e3de6966ab2d37003167f167 # Parent b7cc0f323a4cd98e70f45c18830484dd5a74b03d Fix the py2exe template path problem (issue:152) again. This patch is same with 1834:24881eaebee3 which is leaved behind by 1897:58b6784cf9f1. diff -r b7cc0f323a4c -r 2f500a4b6e99 mercurial/templater.py --- a/mercurial/templater.py Sun Mar 12 16:21:59 2006 -0800 +++ b/mercurial/templater.py Wed Mar 15 06:39:04 2006 +0100 @@ -8,7 +8,7 @@ import re from demandload import demandload from i18n import gettext as _ -demandload(globals(), "cStringIO cgi os time urllib util") +demandload(globals(), "cStringIO cgi sys os time urllib util") esctable = { '\\': '\\', @@ -235,3 +235,7 @@ p = os.path.join(os.path.dirname(__file__), *fl) if (name and os.path.exists(p)) or os.path.isdir(p): return os.path.normpath(p) + else: + # executable version (py2exe) doesn't support __file__ + if hasattr(sys, 'frozen'): + return os.path.join(sys.prefix, "templates")