[gtk-doc] mkdb: don't crash on missing signal docs
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] mkdb: don't crash on missing signal docs
- Date: Fri, 16 Jun 2017 21:18:16 +0000 (UTC)
commit bd0302f25711355ac0adbd39d325ac0fef746883
Author: Stefan Sauer <ensonic users sf net>
Date: Fri Jun 16 23:16:59 2017 +0200
mkdb: don't crash on missing signal docs
When computing the layout of the signal docs, don't crash with index-oob if
doc-strings are missing.
Fixes #783480
gtkdoc/mkdb.py | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gtkdoc/mkdb.py b/gtkdoc/mkdb.py
index 9432cc7..e03763f 100644
--- a/gtkdoc/mkdb.py
+++ b/gtkdoc/mkdb.py
@@ -3312,6 +3312,9 @@ def GetSignals(gobject):
indentation = ' ' * (len(callback_name) + 2)
sourceparams = SourceSymbolParams.get(symbol)
+ sourceparam_names = None
+ if sourceparams:
+ sourceparam_names = list(sourceparams) # keys as list
params = SignalPrototypes[i].splitlines()
type_len = len("gpointer")
name_len = len("user_data")
@@ -3324,9 +3327,11 @@ def GetSignals(gobject):
if m:
gtype = m.group(1)
pointer = m.group(2)
- if sourceparams:
- param_name = list(sourceparams)[j] # keys as list
- logging.info('from sourceparams: "%s" (%d: %s)', param_name, j, params[j])
+ if sourceparam_names:
+ if j < len(sourceparam_names):
+ param_name = sourceparam_names[j]
+ logging.info('from sourceparams: "%s" (%d: %s)', param_name, j, params[j])
+ # we're mssing the docs for this param, don't warn here though
else:
param_name = m.group(3)
logging.info('from params: "%s" (%d: %s)', param_name, j, params[j])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]