Skip to content

Commit

Permalink
fix: use warnings instead of logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Birdi7 committed Jun 28, 2020
1 parent d98b4ba commit 0eb5a47
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions aiogram/dispatcher/filters/builtin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import inspect
import logging
import re
import typing
import warnings
from contextvars import ContextVar
from dataclasses import dataclass, field
from typing import Any, Dict, Iterable, Optional, Union
Expand All @@ -13,7 +13,6 @@
from aiogram.types import CallbackQuery, ChatType, InlineQuery, Message, Poll

ChatIDArgumentType = typing.Union[typing.Iterable[typing.Union[int, str]], str, int]
logger = logging.getLogger("aiogram")


def extract_chat_ids(chat_id: ChatIDArgumentType) -> typing.Set[int]:
Expand Down Expand Up @@ -709,7 +708,7 @@ async def check(self, obj: Union[Message, CallbackQuery]):
elif isinstance(obj, CallbackQuery):
obj = obj.message.chat
else:
logger.warning("ChatTypeFilter doesn't support %s as input", type(obj))
warnings.warn("ChatTypeFilter doesn't support %s as input", type(obj))
return False

return obj.type in self.chat_type

0 comments on commit 0eb5a47

Please sign in to comment.