labjack / LabJackPython

The official Python modules and classes for interacting with the LabJack U3, U6, UE9 and U12
https://labjack.com/support/software/examples/ud/labjackpython
MIT License
117 stars 79 forks source link

Fix for changing arguments with serial communication methods. #114

Closed markrages closed 3 years ago

markrages commented 3 years ago

Don't mutate argument, even with odd lengths.

Test case:

import u3

lj = u3.openAllU3().popitem()[1]

data = [1]

lj.i2c(0x10,data)

assert data == [1]

(I see that u6.py and ue9.py have the same problem, but I don't have hardware to test those.)

davelopez01 commented 3 years ago

Thanks for catching and fixing. I pulled in the changes and will look into fixing the same issues for the U6 and UE9.