Commits

Antoine Pitrou committed 18f4430

Forbid parent(level) with level < 1

  • Participants
  • Parent commits 59b1cff

Comments (0)

Files changed (1)

 
     def parent(self, level=1):
         """A parent or ancestor (if `level` is specified) of this path."""
+        if level < 1:
+            raise ValueError("`level` must be a non-zero positive integer")
         drv = self._drv
         root = self._root
         parts = self._parts[:-level]