google.takeout.paths: return Optional if there are no takeouts
This commit is contained in:
parent
4666378f7e
commit
e8e4994c02
6 changed files with 30 additions and 19 deletions
|
@ -37,8 +37,8 @@ def get_takeouts(*, path: Optional[str]=None) -> Iterable[Path]:
|
|||
yield takeout
|
||||
|
||||
|
||||
def get_last_takeout(*, path: Optional[str]=None) -> Path:
|
||||
return last(get_takeouts(path=path))
|
||||
def get_last_takeout(*, path: Optional[str]=None) -> Optional[Path]:
|
||||
return last(get_takeouts(path=path), default=None)
|
||||
|
||||
|
||||
# TODO might be a good idea to merge across multiple takeouts...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue