Changeset 4986


Ignore:
Timestamp:
Feb 5, 2008, 1:31:57 PM (17 years ago)
Author:
steve
Message:

Fixed problem with zlib.crc32 and binascii.crc32 on 64 bit machine,
they gave different answers.

Location:
anuga_core/source/anuga/utilities
Files:
2 edited

Legend:

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

    r4977 r4986  
    180180    """
    181181
    182     #from zlib import crc32
    183     from binascii import crc32 #(works as well)
     182    from zlib import crc32
     183    # On bogong binascii.crc32 gave a different answer to
     184    # zlib.crc32
     185    #from binascii import crc32 #(works as well on 32 bit machines)
    184186   
    185187    fid = open(filename)
    186188    crcval = crc32(fid.read(max_length))
     189
    187190    fid.close()
    188191    return crcval
  • anuga_core/source/anuga/utilities/test_system_tools.py

    r4977 r4986  
    4242        fid.write(string)
    4343        fid.flush()
    44 
     44        fid.close()
    4545
    4646        ref_crc = zlib.crc32(string)
    4747
     48        checksum = compute_checksum(tmp_name)
    4849
    49 
    50         checksum = compute_checksum(tmp_name)
    5150
    5251        assert checksum == ref_crc
    5352
    54         fid.close()
    5553        os.remove(tmp_name)
    5654       
    57 
    5855
    5956
Note: See TracChangeset for help on using the changeset viewer.