def get_file_extension(filename):
  """Helper to get the extension of a file. Returns None if the file has no
  extension.
  """
  try:
    return filename.rsplit('.', 1)[1]
  except IndexError:
    return None