Changeset 81475250 in mainline for tools/xstruct.py


Ignore:
Timestamp:
2012-04-08T11:40:35Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d9f53877
Parents:
1dbe465 (diff), 6582b36 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Build scripts work with Python 3 (thx Sean Bartell)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/xstruct.py

    r1dbe465 r81475250  
    3232
    3333import struct
     34import sys
    3435import types
    3536
     37integer_types = (int, long) if sys.version < '3' else (int,)
     38
    3639ranges = {
    37         'B': ((int, long), 0x00, 0xff),
    38         'H': ((int, long), 0x0000, 0xffff),
    39         'L': ((int, long), 0x00000000, 0xffffffff),
    40         'Q': ((int, long), 0x0000000000000000, 0xffffffffffffffff),
    41         'b': ((int, long), -0x80, 0x7f),
    42         'h': ((int, long), -0x8000, 0x7fff),
    43         'l': ((int, long), -0x80000000, 0x7fffffff) ,
    44         'q': ((int, long), -0x8000000000000000, 0x7fffffffffffffff),
     40        'B': (integer_types, 0x00, 0xff),
     41        'H': (integer_types, 0x0000, 0xffff),
     42        'L': (integer_types, 0x00000000, 0xffffffff),
     43        'Q': (integer_types, 0x0000000000000000, 0xffffffffffffffff),
     44        'b': (integer_types, -0x80, 0x7f),
     45        'h': (integer_types, -0x8000, 0x7fff),
     46        'l': (integer_types, -0x80000000, 0x7fffffff) ,
     47        'q': (integer_types, -0x8000000000000000, 0x7fffffffffffffff),
    4548}
    4649
Note: See TracChangeset for help on using the changeset viewer.