Skip to content

Commit 5e5510d

Browse files
committed
add deprecation warning for Python 2.6 users
1 parent 73c60ee commit 5e5510d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

telegram/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
"""A library that provides a Python interface to the Telegram Bot API"""
2121

22+
from sys import version_info
23+
2224
from .base import TelegramObject
2325
from .user import User
2426
from .chat import Chat
@@ -142,3 +144,9 @@
142144
'Venue',
143145
'Video',
144146
'Voice']
147+
148+
149+
if version_info < (2, 7):
150+
from warnings import warn
151+
warn("python-telegram-bot will stop supporting Python 2.6 in a future release. "
152+
"Please upgrade your Python!")

0 commit comments

Comments
 (0)