File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1587,6 +1587,8 @@ def getini(self, name: str):
15871587 ``paths``, ``pathlist``, ``args`` and ``linelist`` : empty list ``[]``
15881588 ``bool`` : ``False``
15891589 ``string`` : empty string ``""``
1590+ ``int`` : ``0``
1591+ ``float`` : ``0.0``
15901592
15911593 If neither the ``default`` nor the ``type`` parameter is passed
15921594 while registering the configuration through
@@ -1656,6 +1658,16 @@ def _getini(self, name: str):
16561658 return _strtobool (str (value ).strip ())
16571659 elif type == "string" :
16581660 return value
1661+ elif type == "int" :
1662+ try :
1663+ return int (value )
1664+ except ValueError :
1665+ raise ValueError (f"invalid integer value { value !r} " )
1666+ elif type == "float" :
1667+ try :
1668+ return float (value )
1669+ except ValueError :
1670+ raise ValueError (f"invalid float value { value !r} " )
16591671 elif type is None :
16601672 return value
16611673 else :
You can’t perform that action at this time.
0 commit comments