diff mercurial/hook.py @ 43712:664e24207728

procutil: move mainfrozen() to new resourceutil.py The i18n module practically depends on procutil for mainfrozen() but since procutil depends on i18n, it would be a circular dependency if i18n depended directly on procutil. The cycle is currently resolved by having the higher-level util module calculate the "datapath" and inject it into i18n. Extracting mainfrozen() to a new module lets us clean up the dependencies. Differential Revision: https://phab.mercurial-scm.org/D7433
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 14 Nov 2019 11:52:22 -0800
parents 313e3a279828
children 3cbbfd0bfc17
line wrap: on
line diff
--- a/mercurial/hook.py	Thu Nov 14 17:36:01 2019 -0800
+++ b/mercurial/hook.py	Thu Nov 14 11:52:22 2019 -0800
@@ -22,6 +22,7 @@
 )
 from .utils import (
     procutil,
+    resourceutil,
     stringutil,
 )
 
@@ -48,7 +49,7 @@
             )
         modname = funcname[:d]
         oldpaths = sys.path
-        if procutil.mainfrozen():
+        if resourceutil.mainfrozen():
             # binary installs require sys.path manipulation
             modpath, modfile = os.path.split(modname)
             if modpath and modfile: