Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy ironpython 2 version check #102491

Closed
eendebakpt opened this issue Mar 7, 2023 · 0 comments
Closed

Remove legacy ironpython 2 version check #102491

eendebakpt opened this issue Mar 7, 2023 · 0 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@eendebakpt
Copy link
Contributor

eendebakpt commented Mar 7, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants