Skip to content

Commit

Permalink
Merge pull request #27 from optuna/add-try-except-to-read-file
Browse files Browse the repository at this point in the history
Add try-except to decode the read file
  • Loading branch information
HideakiImamura authored May 22, 2024
2 parents 8060ccd + 077675d commit 3ef0bcf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion optunahub/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ def _import_github_dir(
package_contents.extend(dir_contents)
else:
with open(file_path, "wb") as f:
f.write(m.decoded_content)
try:
decoded_content = m.decoded_content
except AssertionError:
continue
f.write(decoded_content)

module_path = os.path.join(cache_dir_prefix, dir_path)
module_name = os.path.basename(module_path)
Expand Down

0 comments on commit 3ef0bcf

Please sign in to comment.