def proto1_to_proto2(message, body):
 try:
  (args, kwargs) = (body.get(u'args', ()), body.get(u'kwargs', {}))
  kwargs.items
 except KeyError:
  raise InvalidTaskError(u'Message does not have args/kwargs')
 except AttributeError:
  raise InvalidTaskError(u'Task keyword arguments must be a mapping')
 body.update(argsrepr=saferepr(args), kwargsrepr=saferepr(kwargs), headers=message.headers)
 try:
  body[u'group'] = body[u'taskset']
 except KeyError:
  pass
 embed = {u'callbacks': body.get(u'callbacks'), u'errbacks': body.get(u'errbacks'), u'chord': body.get(u'chord'), u'chain': None}
 return ((args, kwargs, embed), body, True, body.get(u'utc', True))

def proto1_to_proto2 ( message , body ) : try : ( args , kwargs ) = ( body . get ( u'args' , ( ) ) , body . get ( u'kwargs' , { } ) ) kwargs . items except KeyError : raise InvalidTaskError ( u'Message does not have args/kwargs' ) except AttributeError : raise InvalidTaskError ( u'Task keyword arguments must be a mapping' ) body . update ( argsrepr = saferepr ( args ) , kwargsrepr = saferepr ( kwargs ) , headers = message . headers ) try : body [ u'group' ] = body [ u'taskset' ] except KeyError : pass embed = { u'callbacks' : body . get ( u'callbacks' ) , u'errbacks' : body . get ( u'errbacks' ) , u'chord' : body . get ( u'chord' ) , u'chain' : None } return ( ( args , kwargs , embed ) , body , True , body . get ( u'utc' , True ) )
convert task message protocol 1 arguments to protocol 2 .