Skip to content

Commit

Permalink
engine: Use Queue if JoinableQueue has been removed
Browse files Browse the repository at this point in the history
Closes #289
  • Loading branch information
chfoo committed Oct 20, 2015
1 parent 089e931 commit 3e97037
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Unreleased
* Fixed: ``--output-document`` file doesn't contain content.
* Fixed: OverflowError when URL contains invalid port number greater than 65535 or less than 0.
* Fixed: AssertionError when saving IPv4-mapped IPv6 addresses to WARC files.
* Fixed: AttributeError when running with installed Trollius 2.0.
* Changed: The setup file no longer requires optional psutil.


Expand Down
7 changes: 5 additions & 2 deletions wpull/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import abc
import contextlib
import gettext
import itertools
import logging
import os
import itertools

from trollius import From, Return
import trollius
Expand Down Expand Up @@ -33,7 +33,10 @@ def __init__(self):
self.__concurrent = 1
self._running = False
self._item_queue = trollius.PriorityQueue()
self._token_queue = trollius.JoinableQueue()
try:
self._token_queue = trollius.JoinableQueue()
except AttributeError:
self._token_queue = trollius.Queue()
self._item_get_semaphore = trollius.BoundedSemaphore(value=1)

self._producer_task = None
Expand Down

0 comments on commit 3e97037

Please sign in to comment.