Browse Source

Fix for Python 3.

tags/v0.3
Ben Kurtovic 10 years ago
parent
commit
943caede7a
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      mwparserfromhell/wikicode.py

+ 4
- 2
mwparserfromhell/wikicode.py View File

@@ -129,10 +129,12 @@ class Wikicode(StringMixIn):
i += len(obj.nodes) - 1
elif recursive:
contexts = node.__iternodes__(self._get_all_nodes)
for code in {ctx for ctx, child in contexts}:
if code and obj in code:
processed = []
for code in (ctx for ctx, child in contexts):
if code and code not in processed and obj in code:
search = self._do_search(obj, recursive, code, literal)
results.extend(search)
processed.append(code)
i += 1

if not results and not literal and recursive:


Loading…
Cancel
Save