22import logging
33import os
44from pathlib import Path
5+ import sys
56from typing import Any
67
7- try :
8- import tomllib # python>=3.11
9- except ImportError :
10- import tomli as tomllib # backport
8+ if sys . version_info >= ( 3 , 11 ) :
9+ import tomllib
10+ else :
11+ import tomli as tomllib # type: ignore[unresolved-import]
1112
1213from .validation import Config , validate_config
1314
@@ -28,7 +29,7 @@ def configure_logging(logfile, loglevel):
2829 'requests.packages.urllib3.connectionpool' ,
2930 ]
3031 for spammer in spammers :
31- logging .getLogger (spammer ).setLevel (logging .WARN )
32+ logging .getLogger (spammer ).setLevel (logging .WARNING )
3233
3334
3435def get_config_path ():
@@ -134,10 +135,10 @@ def __init__(self, *args, allow_no_value=True, **kwargs):
134135 * args , allow_no_value = allow_no_value , interpolation = None , ** kwargs
135136 )
136137
137- def getint (self , section , option ):
138+ def getint (self , section , option , ** kwargs ):
138139 """Accepts both integers and empty values."""
139140 try :
140- return super ().getint (section , option )
141+ return super ().getint (section , option , ** kwargs )
141142 except ValueError :
142143 if self .get (section , option ) == '' :
143144 return None
@@ -148,7 +149,6 @@ def getint(self, section, option):
148149 )
149150 )
150151
151- @staticmethod
152- def optionxform (option ):
152+ def optionxform (self , optionstr ):
153153 """Do not lowercase key names."""
154- return option
154+ return optionstr
0 commit comments