def sort_pkglist(pkgs):
 try:
  for key in pkgs:
   pkgs[key] = sorted(set(pkgs[key]))
 except AttributeError as exc:
  log.exception(exc)

def sort_pkglist ( pkgs ) : try : for key in pkgs : pkgs [ key ] = sorted ( set ( pkgs [ key ] ) ) except AttributeError as exc : log . exception ( exc )
accepts a dict obtained from pkg .