diff options
author | Steven Bingler <steven.bingler@ni.com> | 2017-12-01 16:41:31 -0600 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:57 -0800 |
commit | 0cb800e001fc443b82f827119597cb2b8167c031 (patch) | |
tree | bb4ac570bd61c1bb49c9cdedf592d06b9544c966 /mpm | |
parent | e98a7159bea9324edc87fcee701ea4de356765bf (diff) | |
download | uhd-0cb800e001fc443b82f827119597cb2b8167c031.tar.gz uhd-0cb800e001fc443b82f827119597cb2b8167c031.tar.bz2 uhd-0cb800e001fc443b82f827119597cb2b8167c031.zip |
mpm: Fix python2 vs python3 zlib.crc32 output difference
Zlib's crc32 outputs signed values in python2 and unsigned values in
python3. As per this page (https://docs.python.org/2/library/zlib.html)
0xffffffff can be AND'd to the result to get the same value between
Python versions
Diffstat (limited to 'mpm')
-rw-r--r-- | mpm/python/usrp_mpm/eeprom.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mpm/python/usrp_mpm/eeprom.py b/mpm/python/usrp_mpm/eeprom.py index 53a4919e4..0ac649ce7 100644 --- a/mpm/python/usrp_mpm/eeprom.py +++ b/mpm/python/usrp_mpm/eeprom.py @@ -131,7 +131,7 @@ def read_eeprom( parsed_data = eeprom_parser.unpack_from(data) read_crc = parsed_data[-1] rawdata_without_crc = eeprom_parser_no_crc.pack(*(parsed_data[0:-1])) - expected_crc = zlib.crc32(rawdata_without_crc) + expected_crc = zlib.crc32(rawdata_without_crc) & 0xffffffff if read_crc != expected_crc: raise RuntimeError( "Received incorrect CRC."\ |