From: Michael Tremer Date: Tue, 7 Jan 2020 20:42:40 +0000 (+0000) Subject: tools: Fix skipping the version line X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef4b14f7dbcbe6f5401f911f3d8d9e0188d2ae99;p=location%2Flocation-database.git tools: Fix skipping the version line Signed-off-by: Michael Tremer --- diff --git a/tools/base.py b/tools/base.py index c04a096..bdd7fbd 100644 --- a/tools/base.py +++ b/tools/base.py @@ -140,14 +140,14 @@ class RIRParser(object): def parse_url(self, url): with self.downloader.request(url) as r: - for i, line in enumerate(r): - # Skip the first line - if i == 0: - continue - + for line in r: self.parse_line(line) def parse_line(self, line): + # Skip version line + if line.startswith("2"): + return + # Skip comments if line.startswith("#"): return