Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pyusb/pyusb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.0
Choose a base ref
...
head repository: pyusb/pyusb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.3.1
Choose a head ref
  • 8 commits
  • 8 files changed
  • 1 contributor

Commits on Jan 1, 2025

  1. Configuration menu
    Copy the full SHA
    8acb57e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2b153a2 View commit details
    Browse the repository at this point in the history
  3. tox: update envlist

    jonasmalacofilho committed Jan 1, 2025
    Configuration menu
    Copy the full SHA
    0573e84 View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2025

  1. util: raise TypeError if create_buffer doesn't receive a length

    `Device.ctrl_transfer` depends on `create_buffer` raising a `TypeError`
    if its parameter is not a valid length. In particular, if an array is
    passed in, `create_buffer` must *not* return a copy of it.
    
    Commit 3ea79b0 accidentally broke this and, consequently, any calls
    to `ctrl_transfer` passing in a buffer. Thanks @kauwua for reporting the
    issue and discussing the potential solutions.
    
    Note that `length * b'\x00'` is actually faster than `bytes(length)`
    (tested with Python 3.13 on x86_64).
    
    Fixes: #528
    Fixes: 3ea79b0 ("util: remove left over python 2 compatibility workaround")
    jonasmalacofilho committed Jan 8, 2025
    Configuration menu
    Copy the full SHA
    5d73f3d View commit details
    Browse the repository at this point in the history
  2. interop: prioritize no-op case but also accept length for a new array

    While discussing #527, @kauwua made the valid point that we could
    optimize for the case where the user has passed in a byte `array`.
    
    In that spirit, prioritize the no-op conversion case, but also accept
    the parameter to be a length for a new array in preparation for
    replacing the conditional in `Device.ctrl_transfer`.
    
    Related: #528
    jonasmalacofilho committed Jan 8, 2025
    Configuration menu
    Copy the full SHA
    0d578a2 View commit details
    Browse the repository at this point in the history
  3. core: replace try-except block with single call to new _interop.as_array

    Optimize for the case where `data_or_wLength` is already a byte `array`,
    as suggested by @kauwua in #527.
    
    Related: #528
    jonasmalacofilho committed Jan 8, 2025
    Configuration menu
    Copy the full SHA
    e920187 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f2b6bb8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    89ea84d View commit details
    Browse the repository at this point in the history
Loading