import queue (like in py3) directly

future module takes care of adding the `queue` package to py2
This commit is contained in:
Noam Meltzer 2016-04-25 10:01:21 +03:00
parent 82282ae125
commit 8a087dce69
3 changed files with 3 additions and 16 deletions

View file

@ -24,11 +24,7 @@ from functools import wraps
from threading import Thread, BoundedSemaphore, Lock, Event, current_thread
from time import sleep
# Adjust for differences in Python versions
try:
from queue import Empty # flake8: noqa
except ImportError:
from Queue import Empty # flake8: noqa
from queue import Empty
from telegram import (TelegramError, NullHandler)
from telegram.ext.handler import Handler

View file

@ -22,11 +22,7 @@
import logging
import time
from threading import Thread, Lock
try:
from queue import PriorityQueue
except ImportError:
from Queue import PriorityQueue
from queue import PriorityQueue
class JobQueue(object):

View file

@ -28,12 +28,7 @@ from threading import Thread, Lock, current_thread, Event
from time import sleep
import subprocess
from signal import signal, SIGINT, SIGTERM, SIGABRT
# Adjust for differences in Python versions
try:
from queue import Queue # flake8: noqa
except ImportError:
from Queue import Queue # flake8: noqa
from queue import Queue
from telegram import Bot, TelegramError, NullHandler
from telegram.ext import dispatcher, Dispatcher, JobQueue