comparison tests/test-demandimport.py @ 44117:c5e0a9b97b8a

hgdemandimport: disable on Python 3.5 The demand importer functionality isn't working at all on Python 3.5. I'm not sure what's wrong. Since it isn't working, let's disable it completely. ``` $ HGRCPATH= hyperfine -w 1 -r 50 -- "~/.pyenv/versions/3.5.9/bin/python ./hg version" \ "HGDEMANDIMPORT=disable ~/.pyenv/versions/3.5.9/bin/python ./hg version" Benchmark #1: ~/.pyenv/versions/3.5.9/bin/python ./hg version Time (mean ± σ): 163.7 ms ± 2.2 ms [User: 148.5 ms, System: 15.7 ms] Range (min … max): 161.0 ms … 170.2 ms 50 runs Benchmark #2: HGDEMANDIMPORT=disable ~/.pyenv/versions/3.5.9/bin/python ./hg version Time (mean ± σ): 164.3 ms ± 1.4 ms [User: 148.2 ms, System: 16.6 ms] Range (min … max): 161.4 ms … 169.8 ms 50 runs ``` Differential Revision: https://phab.mercurial-scm.org/D7953
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 20 Jan 2020 23:42:19 -0800
parents 2372284d9457
children f81c17ec303c
comparison
equal deleted inserted replaced
44116:b5aaa09be18c 44117:c5e0a9b97b8a
18 ): 18 ):
19 sys.exit(80) 19 sys.exit(80)
20 20
21 # We rely on assert, which gets optimized out. 21 # We rely on assert, which gets optimized out.
22 if sys.flags.optimize: 22 if sys.flags.optimize:
23 sys.exit(80)
24
25 # The demand importer doesn't work on Python 3.5.
26 if sys.version_info[0:2] == (3, 5):
23 sys.exit(80) 27 sys.exit(80)
24 28
25 if ispy3: 29 if ispy3:
26 from importlib.util import _LazyModule 30 from importlib.util import _LazyModule
27 31