changeset 32462:b4810bf95c03

init: turn on demandimport for Python 3.6 and above This uses the new demandimport implementation for Python 3 introduced in previous patches. This doesn't yet enhance performance because it isn't integrated with the custom source file loader we use on Python 3. We'll integrate the two in upcoming patches.
author Siddharth Agarwal <sid0@fb.com>
date Sun, 21 May 2017 12:51:01 -0700
parents 859496bb6db3
children 397e3a2e9347
files hg
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hg	Sun May 21 12:23:04 2017 -0700
+++ b/hg	Sun May 21 12:51:01 2017 -0700
@@ -28,8 +28,8 @@
 
 # enable importing on demand to reduce startup time
 try:
-    if sys.version_info[0] < 3:
-        from mercurial import demandimport; demandimport.enable()
+    if sys.version_info[0] < 3 or sys.version_info >= (3, 6):
+        import hgdemandimport; hgdemandimport.enable()
 except ImportError:
     sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
                      ' '.join(sys.path))