Spaces:
Running on Zero
Running on Zero
Commit ·
242fad5
1
Parent(s): 10c1a7b
Fix: force list_repo_tree generator inside try/except
Browse fileslist_repo_tree returns a lazy generator — the HTTP request fires during
iteration, not on the call itself, so wrapping only the call did not catch
the 404. Wrapping list() forces evaluation inside the try block.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- logging_utils.py +1 -1
logging_utils.py
CHANGED
|
@@ -87,7 +87,7 @@ def _make_path(now, uid):
|
|
| 87 |
|
| 88 |
def _list_existing_files(api, repo_id):
|
| 89 |
try:
|
| 90 |
-
entries = api.list_repo_tree(repo_id, repo_type="dataset", path_in_repo="data")
|
| 91 |
except Exception as e:
|
| 92 |
print(f"[log] could not list existing files (empty repo?): {e}")
|
| 93 |
return []
|
|
|
|
| 87 |
|
| 88 |
def _list_existing_files(api, repo_id):
|
| 89 |
try:
|
| 90 |
+
entries = list(api.list_repo_tree(repo_id, repo_type="dataset", path_in_repo="data"))
|
| 91 |
except Exception as e:
|
| 92 |
print(f"[log] could not list existing files (empty repo?): {e}")
|
| 93 |
return []
|