From 0f2eef61994f1e91d91c6dabed4efec1dbd06f72 Mon Sep 17 00:00:00 2001 From: Sam Broderick Date: Tue, 7 Jun 2022 12:07:03 +0200 Subject: [PATCH] Update inputparser.py Deal with empty "default" NAME --- inputparser.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inputparser.py b/inputparser.py index 33f26509..aa436654 100644 --- a/inputparser.py +++ b/inputparser.py @@ -42,7 +42,11 @@ def validify_keyword(string): """ original = string changed = False - + + if string == None: + print(" Keyword None replaced with NO_DEFAULT") + return "NO_DEFAULT" + if "-" in string: changed = True string = string.replace("-", "_") @@ -178,7 +182,7 @@ def recursive_class_creation(section, level, class_dictionary, version_dictionar newname = validify_keyword(name) if keytype == "default": default_name = newname - if name.startswith("__"): + if name != None and name.startswith("__"): visible = False # Now store the keywords as class attributes