diff mercurial/util.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 38387f9e4d22
children 9fb85668ee15
line wrap: on
line diff
--- a/mercurial/util.py	Thu Nov 14 17:36:01 2019 -0800
+++ b/mercurial/util.py	Thu Nov 14 11:52:22 2019 -0800
@@ -54,6 +54,7 @@
 from .utils import (
     compression,
     procutil,
+    resourceutil,
     stringutil,
 )
 
@@ -1823,7 +1824,7 @@
 
 
 # the location of data files matching the source code
-if procutil.mainfrozen() and getattr(sys, 'frozen', None) != 'macosx_app':
+if resourceutil.mainfrozen() and getattr(sys, 'frozen', None) != 'macosx_app':
     # executable version (py2exe) doesn't support __file__
     datapath = os.path.dirname(pycompat.sysexecutable)
 else: