core: add warnings helper to highlight warnings so they are more visible in the output

This commit is contained in:
Dima Gerasimov 2020-09-27 17:29:43 +02:00 committed by karlicoss
parent cd40fc75c3
commit fbaa8e0b44
3 changed files with 51 additions and 5 deletions

View file

@ -11,10 +11,10 @@ except ImportError as e:
try:
from my.config import twitter as user_config
except ImportError:
raise e # raise the original exception.. must be somethingelse
raise e # raise the original exception.. must be something else
else:
import warnings
warnings.warn('my.config.twitter is deprecated! Please rename it to my.config.twitter_archive in your config')
from ..core import warnings
warnings.high('my.config.twitter is deprecated! Please rename it to my.config.twitter_archive in your config')
from dataclasses import dataclass