mirror of
https://github.com/lilydjwg/nvchecker
synced 2025-01-11 16:59:27 +00:00
Get rid of warnings from logging.warn
logging.warn is deprecated [1]. [1] https://docs.python.org/3/library/logging.html#logging.Logger.warning
This commit is contained in:
parent
2677d29f1d
commit
7dab7c3b6a
@ -189,7 +189,7 @@ class Source:
|
||||
else:
|
||||
conf = config[name]
|
||||
if not conf.getboolean('missing_ok', False):
|
||||
logger.warn('no-result', name=name)
|
||||
logger.warning('no-result', name=name)
|
||||
self.on_no_result(name)
|
||||
|
||||
if self.newver:
|
||||
|
@ -14,7 +14,7 @@ async def get_version(name, conf, **kwargs):
|
||||
try:
|
||||
regex = re.compile(conf['regex'])
|
||||
except sre_constants.error:
|
||||
logger.warn('bad regex, skipped.', name=name, exc_info=True)
|
||||
logger.warning('bad regex, skipped.', name=name, exc_info=True)
|
||||
return
|
||||
|
||||
encoding = conf.get('encoding', 'latin1')
|
||||
|
@ -42,7 +42,7 @@ def take():
|
||||
oldvers[name] = newvers[name]
|
||||
except KeyError:
|
||||
if args.ignore_nonexistent:
|
||||
logger.warn('nonexistent in newver, ignored', name=name)
|
||||
logger.warning('nonexistent in newver, ignored', name=name)
|
||||
continue
|
||||
|
||||
logger.critical(
|
||||
|
@ -62,7 +62,7 @@ def event_loop(request):
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
def raise_on_logger_msg():
|
||||
def proc(logger, method_name, event_dict):
|
||||
if method_name in ('warn', 'error'):
|
||||
if method_name in ('warning', 'error'):
|
||||
if 'exc_info' in event_dict:
|
||||
raise event_dict['exc_info']
|
||||
raise RuntimeError(event_dict['event'])
|
||||
|
Loading…
Reference in New Issue
Block a user