Skip to content

Commit 7203274

Browse files
committed
Replace assert
1 parent 1364326 commit 7203274

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

ripe/atlas/sagan/traceroute.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,8 @@ def ip_path(self):
217217

218218
def _parse_hops(self, parse_all_hops=True, **kwargs):
219219

220-
try:
221-
hops = self.raw_data["result"]
222-
assert(isinstance(hops, list))
223-
except (KeyError, AssertionError):
220+
hops = self.raw_data.get("result")
221+
if not isinstance(hops, list):
224222
self._handle_malformation("Legacy formats not supported")
225223
return
226224

0 commit comments

Comments
 (0)