Merged revisions 74055 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k
(Selected changes only.)
................
r74055 | alexandre.vassalotti | 2009-07-17 11:18:18 +0200 (Fr, 17 Jul 2009) | 55 lines
Merged revisions 73995,74002,74005,74007-74008,74011,74019-74023 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74008 | benjamin.peterson | 2009-07-14 20:46:42 -0400 (Tue, 14 Jul 2009) | 1 line
update year
........
r74011 | ezio.melotti | 2009-07-15 13:07:04 -0400 (Wed, 15 Jul 2009) | 1 line
methods' names pep8ification
........
r74019 | amaury.forgeotdarc | 2009-07-15 17:29:27 -0400 (Wed, 15 Jul 2009) | 2 lines
#6076 Add a title to the IDLE Preferences window.
........
r74020 | georg.brandl | 2009-07-16 03:18:07 -0400 (Thu, 16 Jul 2009) | 1 line
#5910: fix kqueue for calls with more than one event.
........
r74021 | georg.brandl | 2009-07-16 03:33:04 -0400 (Thu, 16 Jul 2009) | 1 line
#6486: start with built in functions rather than "built in objects".
........
r74022 | georg.brandl | 2009-07-16 03:38:35 -0400 (Thu, 16 Jul 2009) | 1 line
#6481: fix typo in os.system() replacement.
........
r74023 | jesse.noller | 2009-07-16 10:23:04 -0400 (Thu, 16 Jul 2009) | 1 line
Issue 6433: multiprocessing.pool.map hangs on empty list
........
................
diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py
index 20ed827..6482119 100644
--- a/Lib/idlelib/configDialog.py
+++ b/Lib/idlelib/configDialog.py
@@ -30,6 +30,7 @@
self.wm_withdraw()
self.configure(borderwidth=5)
+ self.title('IDLE Preferences')
self.geometry("+%d+%d" % (parent.winfo_rootx()+20,
parent.winfo_rooty()+30))
#Theme Elements. Each theme element key is its display name.
diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py
index 5c1805f..d3ecc9b 100644
--- a/Lib/multiprocessing/pool.py
+++ b/Lib/multiprocessing/pool.py
@@ -208,6 +208,8 @@
chunksize, extra = divmod(len(iterable), len(self._pool) * 4)
if extra:
chunksize += 1
+ if len(iterable) == 0:
+ chunksize = 0
task_batches = Pool._get_tasks(func, iterable, chunksize)
result = MapResult(self._cache, chunksize, len(iterable), callback)
diff --git a/Lib/test/test_kqueue.py b/Lib/test/test_kqueue.py
index dd1ecc8..5ba21a2 100644
--- a/Lib/test/test_kqueue.py
+++ b/Lib/test/test_kqueue.py
@@ -163,6 +163,22 @@
server.close()
serverSocket.close()
+ def testPair(self):
+ kq = select.kqueue()
+ a, b = socket.socketpair()
+
+ a.send(b'foo')
+ event1 = select.kevent(a, select.KQ_FILTER_READ, select.KQ_EV_ADD | select.KQ_EV_ENABLE)
+ event2 = select.kevent(b, select.KQ_FILTER_READ, select.KQ_EV_ADD | select.KQ_EV_ENABLE)
+ r = kq.control([event1, event2], 1, 1)
+ self.assertTrue(r)
+ self.assertFalse(r[0].flags & select.KQ_EV_ERROR)
+ self.assertEquals(b.recv(r[0].data), b'foo')
+
+ a.close()
+ b.close()
+ kq.close()
+
def test_main():
support.run_unittest(TestKQueue)
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index 9f4e1a2..18066ba 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -991,6 +991,12 @@
self.assertEqual(pmap(sqr, list(range(100)), chunksize=20),
list(map(sqr, list(range(100)))))
+ def test_map_chunksize(self):
+ try:
+ self.pool.map_async(sqr, [], chunksize=1).get(timeout=TIMEOUT1)
+ except multiprocessing.TimeoutError:
+ self.fail("pool.map_async with chunksize stalled on null list")
+
def test_async(self):
res = self.pool.apply_async(sqr, (7, TIMEOUT1,))
get = TimingWrapper(res.get)