Skip to content

Commit dbd4367

Browse files
committed
VarParsing: prevent TypeError for default of int/float/bool list
1 parent f6e0fc4 commit dbd4367

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

FWCore/ParameterSet/python/VarParsing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,9 @@ def register (self, name,
413413
self._lists[name] = []
414414
# if it's a list, we only want to use the default if it
415415
# does exist.
416-
if len (default):
417-
self._lists[name].append (default)
416+
if (mytype in [VarParsing.varType.bool, VarParsing.varType.int, VarParsing.varType.float] and \
417+
default != "") or len (default): # check type to prevent TypeError for bool/int/float defaults
418+
self._lists[name].append (default) # known bug: default can be list
418419
#######################################
419420
## Process any additional directives ##
420421
#######################################

0 commit comments

Comments
 (0)