better name's validation
This commit is contained in:
@@ -40,9 +40,7 @@ forbidden_names = ('iter_all', 'iter_group', 'find', 'find_first',
|
||||
|
||||
def valid_name(name):
|
||||
"an option's name is a str and does not start with 'impl' or 'cfgimpl'"
|
||||
try:
|
||||
name = str(name)
|
||||
except:
|
||||
if not isinstance(name, str):
|
||||
return False
|
||||
if re.match(name_regexp, name) is None and not name.startswith('_') \
|
||||
and name not in forbidden_names \
|
||||
|
Reference in New Issue
Block a user