Changeset 5045


Ignore:
Timestamp:
Feb 18, 2008, 6:30:35 PM (15 years ago)
Author:
ole
Message:

Made zlib.crc32 compatible on 64 bit platforms.
The fix used is due to Guido as in http://bugs.python.org/issue1202.
In future versions of Python, this will be fixed and the fix unnecessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/utilities/system_tools.py

    r5043 r5045  
    183183   
    184184    fid = open(filename, 'rb') # Use binary for portability
    185     crcval = crc32(fid.read(max_length))
     185    x = crc32(fid.read(max_length))
    186186
    187187    fid.close()
     188
     189    crcval = x - ((x & 0x80000000) << 1) #Guido's 64 bit fix (http://bugs.python.org/issue1202)
     190   
    188191    return crcval
Note: See TracChangeset for help on using the changeset viewer.