Skip to content

Commit 687d281

Browse files
Use sys.maxsize for iteration
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
1 parent 4a46da3 commit 687d281

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bioblend/galaxy/folders/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Contains possible interactions with the Galaxy library folders
33
"""
44

5+
import sys
56
from typing import (
67
Any,
78
Dict,
@@ -107,14 +108,14 @@ def contents_iter(
107108
:rtype: dict
108109
:return: A generator for the folder contents
109110
"""
110-
total_rows: Optional[int] = None
111+
total_rows = sys.maxsize
111112
params = {
112113
"limit": limit,
113114
"offset": 0,
114115
"include_deleted": include_deleted,
115116
}
116117

117-
while total_rows is None or params["offset"] <= total_rows:
118+
while params["offset"] <= total_rows:
118119
chunk = self._get(id=folder_id, contents=True, params=params)
119120
total_rows = chunk["metadata"]["total_rows"]
120121
yield from chunk["folder_contents"]

0 commit comments

Comments
 (0)