Fix exception when logging Qt warning without function.
This commit is contained in:
parent
bc009ae624
commit
5f9c56bcdd
@ -266,8 +266,12 @@ def qt_message_handler(msg_type, context, msg):
|
|||||||
level = logging.DEBUG
|
level = logging.DEBUG
|
||||||
else:
|
else:
|
||||||
level = qt_to_logging[msg_type]
|
level = qt_to_logging[msg_type]
|
||||||
# We get something like "void qt_png_warning(png_structp, png_const_charp)"
|
if context.function is None:
|
||||||
# from Qt, but only want "qt_png_warning".
|
func = 'none'
|
||||||
|
else:
|
||||||
|
# We get something like
|
||||||
|
# "void qt_png_warning(png_structp, png_const_charp)" from Qt, but only
|
||||||
|
# want "qt_png_warning".
|
||||||
match = re.match(r'.*( |::)(\w*)\(.*\)', context.function)
|
match = re.match(r'.*( |::)(\w*)\(.*\)', context.function)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
func = match.group(2)
|
func = match.group(2)
|
||||||
|
Loading…
Reference in New Issue
Block a user