Changeset 3ae927e in trunk


Ignore:
Timestamp:
2020-09-24T01:18:24Z (5 years ago)
Author:
Chad Whitacre <chad@…>
Branches:
master
Children:
06cd64c8
Parents:
42eaf08
Message:

Respond to review

  • Preserve int division
  • Dial back the future imports
Location:
src/allmydata/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/allmydata/test/common.py

    r42eaf08 r3ae927e  
    1 from __future__ import absolute_import
    2 from __future__ import division
    31from __future__ import print_function
    4 from __future__ import unicode_literals
    52
    63__all__ = [
     
    962959    if sharevernum == 1:
    963960        curval = struct.unpack(">L", data[0x0c+0x18:0x0c+0x18+4])[0]
    964         newval = random.randrange(0, max(1, (curval/hashutil.CRYPTO_VAL_SIZE)//2))*hashutil.CRYPTO_VAL_SIZE
     961        newval = random.randrange(0, max(1, (curval//hashutil.CRYPTO_VAL_SIZE)//2))*hashutil.CRYPTO_VAL_SIZE
    965962        newvalstr = struct.pack(">L", newval)
    966963        return data[:0x0c+0x18]+newvalstr+data[0x0c+0x18+4:]
    967964    else:
    968965        curval = struct.unpack(">Q", data[0x0c+0x2c:0x0c+0x2c+8])[0]
    969         newval = random.randrange(0, max(1, (curval/hashutil.CRYPTO_VAL_SIZE)//2))*hashutil.CRYPTO_VAL_SIZE
     966        newval = random.randrange(0, max(1, (curval//hashutil.CRYPTO_VAL_SIZE)//2))*hashutil.CRYPTO_VAL_SIZE
    970967        newvalstr = struct.pack(">Q", newval)
    971968        return data[:0x0c+0x2c]+newvalstr+data[0x0c+0x2c+8:]
  • TabularUnified src/allmydata/test/common_util.py

    r42eaf08 r3ae927e  
    1 from __future__ import absolute_import
    2 from __future__ import division
    31from __future__ import print_function
    4 from __future__ import unicode_literals
    52
    63import os
Note: See TracChangeset for help on using the changeset viewer.