File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,13 +109,18 @@ def validate_float(s):
109109
110110
111111def validate_float_or_None (s ):
112- """convert s to float or raise"""
112+ """convert s to float, None or raise"""
113+ # values directly from the rc file can only be strings,
114+ # so we need to recognize the string "None" and convert
115+ # it into the object. We will be case-sensitive here to
116+ # avoid confusion between string values of 'none', which
117+ # can be a valid string value for some other parameters.
113118 if s is None or s == 'None' :
114119 return None
115120 try :
116121 return float (s )
117122 except ValueError :
118- raise ValueError ('Could not convert "%s" to float' % s )
123+ raise ValueError ('Could not convert "%s" to float or None ' % s )
119124
120125def validate_dpi (s ):
121126 """confirm s is string 'figure' or convert s to float or raise"""
You can’t perform that action at this time.
0 commit comments