Skip to content

Commit b12eca0

Browse files
committed
2 parents 515f611 + 88b621f commit b12eca0

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ nosetests.xml
4444
.project
4545
.pydevproject
4646

47-
# PyCharm
47+
# PyCharm / IntelliJ
4848
.idea
4949

5050
# Generated test file

src/future/moves/multiprocessing.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from __future__ import absolute_import
2+
from future.utils import PY3
3+
4+
from multiprocessing import *
5+
if not PY3:
6+
__future_module__ = True
7+
from multiprocessing.queues import SimpleQueue

src/future/standard_library/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from collections import OrderedDict, Counter, ChainMap # even on Py2.6
3434
from subprocess import getoutput, getstatusoutput
3535
from subprocess import check_output # even on Py2.6
36+
from multiprocessing import SimpleQueue
3637
3738
(The renamed modules and functions are still available under their old
3839
names on Python 2.)
@@ -111,6 +112,7 @@
111112
'future.moves.socketserver': 'socketserver',
112113
'ConfigParser': 'configparser',
113114
'repr': 'reprlib',
115+
'multiprocessing.queues': 'multiprocessing',
114116
# 'FileDialog': 'tkinter.filedialog',
115117
# 'tkFileDialog': 'tkinter.filedialog',
116118
# 'SimpleDialog': 'tkinter.simpledialog',
@@ -187,6 +189,7 @@
187189
('itertools', 'filterfalse','itertools', 'ifilterfalse'),
188190
('itertools', 'zip_longest','itertools', 'izip_longest'),
189191
('sys', 'intern','__builtin__', 'intern'),
192+
('multiprocessing', 'SimpleQueue', 'multiprocessing.queues', 'SimpleQueue'),
190193
# The re module has no ASCII flag in Py2, but this is the default.
191194
# Set re.ASCII to a zero constant. stat.ST_MODE just happens to be one
192195
# (and it exists on Py2.6+).

src/libpasteurize/fixes/fix_imports.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
u"winreg": u"_winreg",
1717
u"configparser": u"ConfigParser",
1818
u"copyreg": u"copy_reg",
19+
u"multiprocessing.SimpleQueue": u"multiprocessing.queues.SimpleQueue",
1920
u"queue": u"Queue",
2021
u"socketserver": u"SocketServer",
2122
u"_markupbase": u"markupbase",

tests/test_future/test_standard_library.py

+9
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,15 @@ def test_bytesio(self):
302302
for method in ['tell', 'read', 'seek', 'close', 'flush', 'getvalue']:
303303
self.assertTrue(hasattr(s, method))
304304

305+
def test_SimpleQueue(self):
306+
from multiprocessing import SimpleQueue
307+
sq = SimpleQueue()
308+
self.assertTrue(sq.empty())
309+
sq.put('thing')
310+
self.assertFalse(sq.empty())
311+
self.assertEqual(sq.get(), 'thing')
312+
self.assertTrue(sq.empty())
313+
305314
def test_queue(self):
306315
import queue
307316
q = queue.Queue()

0 commit comments

Comments
 (0)