From 97d9be790d3ebeaeb266f9c9cc0320a8e791cd10 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 27 Sep 2021 20:31:28 +0200 Subject: remove walrus This makes wikimini work with Python below 3.8. --- wikimini/document.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wikimini/document.py b/wikimini/document.py index 6d8e873..7036f67 100644 --- a/wikimini/document.py +++ b/wikimini/document.py @@ -292,7 +292,11 @@ class Paragraph(Block): # (mainly if their text also contains links, in which case it'd require # multiple parsing passes). As a quick and dirty fix, we just delete # that stuff here: - while match := re.search("\\[\\[\\w+:.+?\\]\\]", self.plain()): + match = None + while True: + match = re.search("\\[\\[\\w+:.+?\\]\\]", self.plain()) + if not match: + break start_node, start_pos = self._find_index(match.start()) end_node, end_pos = self._find_index(match.end()) -- cgit v1.2.3