One function

UsbReadFailedError in JeffLIrion/adb_shell

The author described this change as fix: Ensure `UsbReadFailedError` can be pickled (#183). It counts as a record because the check below fails on the code as it stood at e7d8b59e3 and passes on 4fb4b2e4f, with nothing else changed between the two runs.

Fix saved2021-08-03
Sharing licenceApache-2.0 · LICENSE
Change size+2 2

What the code was meant to do, written into the code itself as a docstring

TODO Parameters ---------- msg : str The error message usb_error : libusb1.USBError An exception from `libusb1` Attributes ---------- usb_error : libusb1.USBError An exception from `libusb1`

The change

1515
1616 """
1717 def __init__(self, msg, usb_error):
18- super(UsbReadFailedError, self).__init__(msg)
18+ super(UsbReadFailedError, self).__init__(msg, usb_error)
1919 self.usb_error = usb_error
2020
2121 def __str__(self):
22- return '%s: %s' % (super(UsbReadFailedError, self).__str__(), str(self.usb_error))
22+ return '%s: %s' % self.args

The check that tells the two apart

failpass·tests/test_exceptions.py::TestExceptionSerialization::test_serialize_UsbReadFailedError

Check file tests/test_exceptions.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before ite7d8b59e3547cc44d8764608b5da470197d66ab1
Broken version dated2021-07-30
Moduleadb_shell.exceptions
Units changedUsbReadFailedError
Fingerprintd1a13f76532807f3
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.