diff mercurial/templater.py @ 43674:5be909dbe385

util: remove datapath and swith users over to resourceutil The util module no longer needs the datapath for injecting it into the i18n module, so we can remove it from there and update other users. Differential Revision: https://phab.mercurial-scm.org/D7436
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 14 Nov 2019 13:18:22 -0800
parents 70d42e2ad9b4
children fc1fa3a07af6
line wrap: on
line diff
--- a/mercurial/templater.py	Thu Nov 14 12:41:33 2019 -0800
+++ b/mercurial/templater.py	Thu Nov 14 13:18:22 2019 -0800
@@ -80,7 +80,10 @@
     templateutil,
     util,
 )
-from .utils import stringutil
+from .utils import (
+    resourceutil,
+    stringutil,
+)
 
 # template parsing
 
@@ -1042,7 +1045,10 @@
 def templatepaths():
     '''return locations used for template files.'''
     pathsrel = [b'templates']
-    paths = [os.path.normpath(os.path.join(util.datapath, f)) for f in pathsrel]
+    paths = [
+        os.path.normpath(os.path.join(resourceutil.datapath, f))
+        for f in pathsrel
+    ]
     return [p for p in paths if os.path.isdir(p)]