<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GetAncestors(self):
 """Yields all ancestors of a path. The ancestors are returned in order from closest to the farthest one. Yields: Instances of `rdf_objects.PathInfo`. """

    current = self
    while True:
      current = current.GetParent()
      if current is None:
        return
      yield current