Skip to content

Conversation

@radfish
Copy link

@radfish radfish commented Jun 24, 2024

This backport was needed only for Python 2 (the shutil.which module was backported from Python 3 to 2). In Python 3, the module is imported from the built-in standard library.

This resolves issues with packaging for distributions, since that backported package doesn't exist.ror if missing.

See libagent/util.py:241:

    try:
        # For Python 3
        from shutil import which as _which
    except ImportError:
        # For Python 2
        from backports.shutil_which import which as _which

If Python 2 is still supported, then the dependency in setup.py would need to be made conditional on Python version. I am assuming Python 2 is not actually supported, so I just removed the dependency altogether. This try catch in util.py could also be removed, if Python 2 is not actually supported.

This backport was needed only for Python 2 (the shutil.which module was
backported from Python 3 to 2). In Python 3, the module is imported from
the built-in standard library.

This resolves issues with packaging for distributions, since that
backported package doesn't exist.
@Midar
Copy link

Midar commented Sep 21, 2024

This should be merged, as distros that ship trezor-agent currently all patch this out.

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