Skip to content

Commit

Permalink
Update client.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ddomingof committed Feb 9, 2022
1 parent c083be0 commit 7ac0bf4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bio2bel_kegg/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ def ensure_kegg_entity(entity_id: str) -> Tuple[str, List[str]]:
entity_text_path = os.path.join(entity_type_directory, f'{identifier}.txt')

if not os.path.exists(entity_text_path):
urlretrieve(f'http://rest.kegg.jp/get/{entity_id}', entity_text_path) # noqa:S310
try:
urlretrieve(f'http://rest.kegg.jp/get/{entity_id}', entity_text_path) # noqa:S310
except Exception:
return None, None

with open(entity_text_path) as file:
lines = [line.strip() for line in file]
Expand Down

0 comments on commit 7ac0bf4

Please sign in to comment.