Skip to content

Commit 1a35408

Browse files
committed
Update configparser.py
1 parent 7f5e974 commit 1a35408

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/configparser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,9 @@ def _convert_to_boolean(self, value):
12231223
"""Return a boolean value translating from other types if necessary.
12241224
"""
12251225
if value is None:
1226-
raise TypeError('Cannot convert a value-less option to a boolean')
1226+
raise TypeError(
1227+
"getboolean() option value must be a string, not 'NoneType'"
1228+
)
12271229
if value.lower() not in self.BOOLEAN_STATES:
12281230
raise ValueError('Not a boolean: %s' % value)
12291231
return self.BOOLEAN_STATES[value.lower()]

0 commit comments

Comments
 (0)