mercurial/templater.py
changeset 22633 92b54547ac5d
parent 22434 40ce05b50148
child 22634 e48a5d3996c2
--- a/mercurial/templater.py	Sun Sep 28 16:57:06 2014 +0200
+++ b/mercurial/templater.py	Sun Sep 28 16:57:06 2014 +0200
@@ -6,7 +6,7 @@
 # GNU General Public License version 2 or any later version.
 
 from i18n import _
-import sys, os, re
+import os, re
 import util, config, templatefilters, templatekw, parser, error
 import revset as revsetmod
 import types
@@ -715,17 +715,12 @@
     returns None if not found.'''
     normpaths = []
 
-    # executable version (py2exe) doesn't support __file__
-    if util.mainfrozen():
-        module = sys.executable
-    else:
-        module = __file__
     for f in path:
         if f.startswith('/'):
             p = f
         else:
             fl = f.split('/')
-            p = os.path.join(os.path.dirname(module), *fl)
+            p = os.path.join(util.datapath, *fl)
         if name:
             p = os.path.join(p, name)
         if name and os.path.exists(p):