Skip to content

Commit

Permalink
Use sys.maxint for iteration
Browse files Browse the repository at this point in the history
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
  • Loading branch information
bernt-matthias and nsoranzo authored Feb 4, 2025
1 parent 4a46da3 commit 171ed43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bioblend/galaxy/folders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ def contents_iter(
:rtype: dict
:return: A generator for the folder contents
"""
total_rows: Optional[int] = None
total_rows = sys.maxsize
params = {
"limit": limit,
"offset": 0,
"include_deleted": include_deleted,
}

while total_rows is None or params["offset"] <= total_rows:
while params["offset"] <= total_rows:
chunk = self._get(id=folder_id, contents=True, params=params)
total_rows = chunk["metadata"]["total_rows"]
yield from chunk["folder_contents"]
Expand Down

0 comments on commit 171ed43

Please sign in to comment.