Skip to content

Commit 00bba73

Browse files
authored
drop Python 2.6 support (closes python-telegram-bot#245) (python-telegram-bot#386)
* drop Python 2.6 support (closes python-telegram-bot#245) * fix NullHandler import * README: explicitly mention Py3 and PyPy compatibility
1 parent e9c5ee7 commit 00bba73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+51
-238
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: python
22
python:
3-
- "2.6"
43
- "2.7"
54
- "3.3"
65
- "3.4"
@@ -13,6 +12,6 @@ install:
1312
- pip install -r requirements-dev.txt
1413
script:
1514
- nosetests -v --with-flaky --no-flaky-report --with-coverage --cover-package=telegram/
16-
- 'if [ $TRAVIS_PYTHON_VERSION != 2.6 ] && [ $TRAVIS_PYTHON_VERSION != 3.3 ] && [ $TRAVIS_PYTHON_VERSION != pypy3 ]; then pre-commit run --all-files; fi'
15+
- 'if [ $TRAVIS_PYTHON_VERSION != 3.3 ] && [ $TRAVIS_PYTHON_VERSION != pypy3 ]; then pre-commit run --all-files; fi'
1716
after_success:
1817
coveralls

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ Introduction
7373

7474
This library provides a pure Python interface for the
7575
`Telegram Bot API <https://core.telegram.org/bots/api>`_.
76-
It works with Python versions from 2.6+ (**Note:** Support for 2.6 will be dropped at some point
77-
this year. 2.7 will still be supported).
76+
It's compatible with Python versions 2.7, 3.3+ and `PyPy <http://pypy.org/>`_.
7877
It also works with `Google App Engine <https://cloud.google.com/appengine>`_.
7978

8079
In addition to the pure API implementation, this library features a number of high-level classes to

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ flake8
22
nose
33
pep257
44
pylint
5-
unittest2
65
flaky
76
yapf
87
pre-commit

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def requirements():
4545
'Topic :: Internet',
4646
'Programming Language :: Python',
4747
'Programming Language :: Python :: 2',
48-
'Programming Language :: Python :: 2.6',
4948
'Programming Language :: Python :: 2.7',
5049
'Programming Language :: Python :: 3',
5150
'Programming Language :: Python :: 3.3',

telegram/__init__.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
from .error import TelegramError
4444
from .inputfile import InputFile
4545
from .file import File
46-
from .nullhandler import NullHandler
4746
from .emoji import Emoji
4847
from .parsemode import ParseMode
4948
from .messageentity import MessageEntity
@@ -101,14 +100,9 @@
101100
'InlineQueryResultVenue', 'InlineQueryResultVideo', 'InlineQueryResultVoice',
102101
'InputContactMessageContent', 'InputFile', 'InputLocationMessageContent',
103102
'InputMessageContent', 'InputTextMessageContent', 'InputVenueMessageContent',
104-
'KeyboardButton', 'Location', 'Message', 'MessageEntity', 'NullHandler', 'ParseMode',
105-
'PhotoSize', 'ReplyKeyboardHide', 'ReplyKeyboardMarkup', 'ReplyMarkup', 'Sticker',
106-
'TelegramError', 'TelegramObject', 'Update', 'User', 'UserProfilePhotos', 'Venue',
107-
'Video', 'Voice', 'MAX_MESSAGE_LENGTH', 'MAX_CAPTION_LENGTH', 'SUPPORTED_WEBHOOK_PORTS',
103+
'KeyboardButton', 'Location', 'Message', 'MessageEntity', 'ParseMode', 'PhotoSize',
104+
'ReplyKeyboardHide', 'ReplyKeyboardMarkup', 'ReplyMarkup', 'Sticker', 'TelegramError',
105+
'TelegramObject', 'Update', 'User', 'UserProfilePhotos', 'Venue', 'Video', 'Voice',
106+
'MAX_MESSAGE_LENGTH', 'MAX_CAPTION_LENGTH', 'SUPPORTED_WEBHOOK_PORTS',
108107
'MAX_FILESIZE_DOWNLOAD', 'MAX_FILESIZE_UPLOAD', 'MAX_MESSAGES_PER_SECOND_PER_CHAT',
109108
'MAX_MESSAGES_PER_SECOND', 'MAX_MESSAGES_PER_MINUTE_PER_GROUP']
110-
111-
if version_info < (2, 7):
112-
from warnings import warn
113-
warn("python-telegram-bot will stop supporting Python 2.6 in a future release. "
114-
"Please upgrade your Python version to at least Python 2.7!")

telegram/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
import logging
2424

2525
from telegram import (User, Message, Update, Chat, ChatMember, UserProfilePhotos, File,
26-
ReplyMarkup, TelegramObject, NullHandler)
26+
ReplyMarkup, TelegramObject)
2727
from telegram.error import InvalidToken
2828
from telegram.utils import request
2929

30-
logging.getLogger(__name__).addHandler(NullHandler())
30+
logging.getLogger(__name__).addHandler(logging.NullHandler())
3131

3232

3333
class Bot(TelegramObject):

telegram/contrib/botan.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import logging
2-
from telegram import NullHandler
32

43
from future.moves.urllib.parse import quote
54
from future.moves.urllib.error import HTTPError, URLError
65
from future.moves.urllib.request import urlopen, Request
76

8-
logging.getLogger(__name__).addHandler(NullHandler())
7+
logging.getLogger(__name__).addHandler(logging.NullHandler())
98

109

1110
class Botan(object):

telegram/ext/dispatcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626

2727
from future.builtins import range
2828

29-
from telegram import (TelegramError, NullHandler)
29+
from telegram import TelegramError
3030
from telegram.utils import request
3131
from telegram.ext.handler import Handler
3232
from telegram.utils.deprecate import deprecate
3333
from telegram.utils.promise import Promise
3434

35-
logging.getLogger(__name__).addHandler(NullHandler())
35+
logging.getLogger(__name__).addHandler(logging.NullHandler())
3636

3737
ASYNC_QUEUE = Queue()
3838
ASYNC_THREADS = set()

telegram/ext/updater.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
from signal import signal, SIGINT, SIGTERM, SIGABRT
2929
from queue import Queue
3030

31-
from telegram import Bot, TelegramError, NullHandler
31+
from telegram import Bot, TelegramError
3232
from telegram.ext import dispatcher, Dispatcher, JobQueue
3333
from telegram.error import Unauthorized, InvalidToken
3434
from telegram.utils.webhookhandler import (WebhookServer, WebhookHandler)
3535

36-
logging.getLogger(__name__).addHandler(NullHandler())
36+
logging.getLogger(__name__).addHandler(logging.NullHandler())
3737

3838

3939
class Updater(object):

telegram/nullhandler.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)