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

Build: fix range error for missing module 'past' #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ashang
Copy link

@ashang ashang commented Dec 2, 2022

On systems without future, there would issues with missing past.

    from past.builtins import xrange
ModuleNotFoundError: No module named 'past'

Installing future like pip install future can help, but it bothers.

Changing xrange to range can be OK since python3 has no xrange anymore, while both 2 and 3 can have range.

The performance impact with python2 should be minor.

Tested OK on latest Debian bullseye/bookworm, Ubuntu jammy, and Archlinux, with python2 linked to 2.7.18, or 2.7.3, while python linked to 3.10.8, 3.10.6, or 3.9.2.

On systems without `future`, there would issues with missing `past`.

        from past.builtins import xrange
    ModuleNotFoundError: No module named 'past'

Installing `future` like `pip install future` can help, but it bothers.

Changing `xrange` to `range` can be OK since python3 has no `xrange`
anymore, while both 2 and 3 can have `range`.

The performance impact with python2 should be minor.

Tested OK on latest Debian bullseye/bookworm, Ubuntu jammy, and
Archlinux, with python2 linked to 2.7.18, or 2.7.3, while python linked
to 3.10.8, 3.10.6, or 3.9.2.
@ashang
Copy link
Author

ashang commented Dec 2, 2022

Possibly this can fix #100.

This relates to and works with both #142 and #147.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants