Skip to content

Commit 8a087dc

Browse files
committed
import queue (like in py3) directly
future module takes care of adding the `queue` package to py2
1 parent 82282ae commit 8a087dc

3 files changed

Lines changed: 3 additions & 16 deletions

File tree

telegram/ext/dispatcher.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424
from threading import Thread, BoundedSemaphore, Lock, Event, current_thread
2525
from time import sleep
2626

27-
# Adjust for differences in Python versions
28-
try:
29-
from queue import Empty # flake8: noqa
30-
except ImportError:
31-
from Queue import Empty # flake8: noqa
27+
from queue import Empty
3228

3329
from telegram import (TelegramError, NullHandler)
3430
from telegram.ext.handler import Handler

telegram/ext/jobqueue.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@
2222
import logging
2323
import time
2424
from threading import Thread, Lock
25-
26-
try:
27-
from queue import PriorityQueue
28-
except ImportError:
29-
from Queue import PriorityQueue
25+
from queue import PriorityQueue
3026

3127

3228
class JobQueue(object):

telegram/ext/updater.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@
2828
from time import sleep
2929
import subprocess
3030
from signal import signal, SIGINT, SIGTERM, SIGABRT
31-
32-
# Adjust for differences in Python versions
33-
try:
34-
from queue import Queue # flake8: noqa
35-
except ImportError:
36-
from Queue import Queue # flake8: noqa
31+
from queue import Queue
3732

3833
from telegram import Bot, TelegramError, NullHandler
3934
from telegram.ext import dispatcher, Dispatcher, JobQueue

0 commit comments

Comments
 (0)