def post_build(self, p, pay):
        # type: (str, str) -> str
        """
        @param str p: the stringified packet
        @param str pay: the stringified payload
        @return str: the stringified packet and payload, with the packet length field "patched"  # noqa: E501
        @raise AssertionError
        """
        # This logic, while awkward in the post_build and more reasonable in
        # a self_build is implemented here for performance tricks reason
        if self.getfieldval('len') is None:
            assert(len(pay) < (1 << 24)), 'Invalid length: payload is too long'
            p = struct.pack('!L', len(pay))[1:] + p[3:]
        return super(H2Frame, self).post_build(p, pay)
def post_build ( self , p , pay ) : if self . getfieldval ( 'len' ) is None : assert ( len ( pay ) < ( 1 << 24 ) ) , 'Invalid length: payload is too long' p = struct . pack ( '!L' , len ( pay ) ) [ 1 : ] + p [ 3 : ] return super ( H2Frame , self ) . post_build ( p , pay )
@param str p: the stringified packet
        @param str pay: the stringified payload
        @return str: the stringified packet and payload, with the packet length field "patched"  # noqa: E501
        @raise AssertionError