def wrap_old_error_serializer(old_fn):
 def new_fn(req, resp, exception):
  (media_type, body) = old_fn(req, exception)
  if (body is not None):
   resp.body = body
   resp.content_type = media_type
 return new_fn

def wrap_old_error_serializer ( old_fn ) : def new_fn ( req , resp , exception ) : ( media_type , body ) = old_fn ( req , exception ) if ( body is not None ) : resp . body = body resp . content_type = media_type return new_fn
wraps an old-style error serializer to add body/content_type setting .