Closed
Description
Bug report
The platform module contains various version checks for systems such as cpython and ironpython. The file also contains a specfic case for ironpython 2.6 and 2.7 which can be removed (platform.py does not run with python2)
Removing the check improves the import speed as it avoids the compilation of a regular expression.
%timeit _ironpython26_sys_version_parser = re.compile(r'([\d.]+)\s*' r'\(IronPython\s*' r'[\d.]+\s*' r'\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)' )
383 ns ± 1.66 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)