Skip to content

Commit c81f266

Browse files
authored
Merge pull request #8300 from redsun82/check-qhelp
check-qhelp: call super init in IncludeHandler
2 parents 94cb5c2 + ef4d1de commit c81f266

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

misc/scripts/check-qhelp.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,25 @@
88
"""
99

1010
import pathlib
11-
import tempfile
12-
import sys
1311
import subprocess
12+
import sys
13+
import tempfile
1414
import xml.sax
1515

16-
1716
include_cache = {}
1817

18+
1919
class IncludeHandler(xml.sax.ContentHandler):
2020
def __init__(self, xml):
21+
super().__init__()
2122
self.__xml = xml
2223

2324
def startElement(self, name, attrs):
2425
if name == "include":
2526
src = (self.__xml.parent / attrs["src"]).resolve()
2627
include_cache.setdefault(src, set()).add(self.__xml)
2728

29+
2830
class IgnoreErrorsHandler(xml.sax.ErrorHandler):
2931
def error(self, exc):
3032
pass
@@ -35,6 +37,7 @@ def fatalError(self, exc):
3537
def warning(self, exc):
3638
pass
3739

40+
3841
def init_include_cache():
3942
if not include_cache:
4043
for qhelp in pathlib.Path().rglob("*.qhelp"):
@@ -45,6 +48,7 @@ def find_inc_qhelp_usages(arg):
4548
init_include_cache()
4649
return include_cache.get(arg.resolve(), ())
4750

51+
4852
def transform_inputs(args):
4953
for arg in args:
5054
arg = pathlib.Path(arg)
@@ -54,6 +58,7 @@ def transform_inputs(args):
5458
else:
5559
yield str(arg)
5660

61+
5762
affected_qhelp_files = list(transform_inputs(sys.argv[1:]))
5863
if not affected_qhelp_files:
5964
# can happen with changes on an unused .inc.qhelp file

0 commit comments

Comments
 (0)