3 ^c@sddlZddlTeeZddZGdddeeZejdkr\dZ eZ Gd d d eed Z n0ejd krd Z eZ Gdddeed Z ne ddS)N)Z*cCsLt|trt|tSt|tr.t|j|jSt|t r<|St d|dS)Nz+This type does not support other endian: %s) Zhasattr _OTHER_ENDIANZgetattrZ isinstance _array_type _other_endianZ_type_Z_length_Z issubclass StructureZ TypeError)typr&/usr/lib64/python3.6/ctypes/_endian.pyrs    rcseZdZfddZZS) _swapped_metacsb|dkrPg}x>|D]6}|d}|d}|dd}|j|t|f|qW|}tj||dS)NZ_fields_rii)ZappendrZsuper __setattr__)ZselfZattrnameZvalueZfieldsZdescZnamerZrestZ __class__rrr s  z_swapped_meta.__setattr__)__name__ __module__ __qualname__r Z __classcell__rrr rrsrZlittleZ __ctype_be__c@eZdZfZdZdS)BigEndianStructureNr r r Z __slots__Z_swappedbytes_rrrrr.r)Z metaclassZbigZ __ctype_le__c@r)LittleEndianStructureNrrrrrr7rrzInvalid byteorder) ZsysZctypesZtypeZArrayrrrrZ byteorderrrrZ RuntimeErrorrrrrZs