From 5e5510d42baf967ac12546026235a33fb5aafe59 Mon Sep 17 00:00:00 2001 From: Rahiel Kasim Date: Thu, 28 Apr 2016 17:56:03 +0200 Subject: [PATCH] add deprecation warning for Python 2.6 users --- telegram/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/telegram/__init__.py b/telegram/__init__.py index 314556de8..b39ed4a63 100644 --- a/telegram/__init__.py +++ b/telegram/__init__.py @@ -19,6 +19,8 @@ """A library that provides a Python interface to the Telegram Bot API""" +from sys import version_info + from .base import TelegramObject from .user import User from .chat import Chat @@ -142,3 +144,9 @@ __all__ = ['Audio', 'Venue', 'Video', 'Voice'] + + +if version_info < (2, 7): + from warnings import warn + warn("python-telegram-bot will stop supporting Python 2.6 in a future release. " + "Please upgrade your Python!")