Show More
@@ -36,6 +36,12 b' from . import tracing' | |||
|
36 | 36 | |
|
37 | 37 | _deactivated = False |
|
38 | 38 | |
|
39 | # Python 3.5's LazyLoader doesn't work for some reason. | |
|
40 | # https://bugs.python.org/issue26186 is a known issue with extension | |
|
41 | # importing. But it appears to not have a meaningful effect with | |
|
42 | # Mercurial. | |
|
43 | _supported = sys.version_info[0:2] >= (3, 6) | |
|
44 | ||
|
39 | 45 | |
|
40 | 46 | class _lazyloaderex(importlib.util.LazyLoader): |
|
41 | 47 | """This is a LazyLoader except it also follows the _deactivated global and |
@@ -51,15 +57,9 b' class _lazyloaderex(importlib.util.LazyL' | |||
|
51 | 57 | super().exec_module(module) |
|
52 | 58 | |
|
53 | 59 | |
|
54 | # This is 3.6+ because with Python 3.5 it isn't possible to lazily load | |
|
55 | # extensions. See the discussion in https://bugs.python.org/issue26186 for more. | |
|
56 | if sys.version_info[0:2] >= (3, 6): | |
|
57 | _extensions_loader = _lazyloaderex.factory( | |
|
58 | importlib.machinery.ExtensionFileLoader | |
|
59 | ) | |
|
60 | else: | |
|
61 | _extensions_loader = importlib.machinery.ExtensionFileLoader | |
|
62 | ||
|
60 | _extensions_loader = _lazyloaderex.factory( | |
|
61 | importlib.machinery.ExtensionFileLoader | |
|
62 | ) | |
|
63 | 63 | _bytecode_loader = _lazyloaderex.factory( |
|
64 | 64 | importlib.machinery.SourcelessFileLoader |
|
65 | 65 | ) |
@@ -97,6 +97,9 b' def disable():' | |||
|
97 | 97 | |
|
98 | 98 | |
|
99 | 99 | def enable(): |
|
100 | if not _supported: | |
|
101 | return | |
|
102 | ||
|
100 | 103 | sys.path_hooks.insert(0, _makefinder) |
|
101 | 104 | |
|
102 | 105 |
General Comments 0
You need to be logged in to leave comments.
Login now