Skip to content

Remove legacy ironpython 2 version check #102491

Closed
@eendebakpt

Description

@eendebakpt

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)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions