Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d80344f

Browse files
committed
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://[email protected]/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 ........ ................
1 parent a85ee5c commit d80344f

10 files changed

Lines changed: 37 additions & 7 deletions

File tree

Doc/copyright.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright
44

55
Python and this documentation is:
66

7-
Copyright © 2001-2008 Python Software Foundation. All rights reserved.
7+
Copyright © 2001-2009 Python Software Foundation. All rights reserved.
88

99
Copyright © 2000 BeOpen.com. All rights reserved.
1010

Doc/library/intro.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ browse the table of contents (in front of the manual), or look for a specific
4343
function, module or term in the index (in the back). And finally, if you enjoy
4444
learning about random subjects, you choose a random page number (see module
4545
:mod:`random`) and read a section or two. Regardless of the order in which you
46-
read the sections of this manual, it helps to start with chapter :ref:`builtin`,
47-
as the remainder of the manual assumes familiarity with this material.
46+
read the sections of this manual, it helps to start with chapter
47+
:ref:`built-in-funcs`, as the remainder of the manual assumes familiarity with
48+
this material.
4849

4950
Let the show begin!
5051

Doc/library/subprocess.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ Replacing :func:`os.system`
424424
sts = os.system("mycmd" + " myarg")
425425
==>
426426
p = Popen("mycmd" + " myarg", shell=True)
427-
sts = os.waitpid(p.pid, 0)
427+
sts = os.waitpid(p.pid, 0)[1]
428428

429429
Notes:
430430

Lib/idlelib/configDialog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def __init__(self,parent,title):
3030
self.wm_withdraw()
3131

3232
self.configure(borderwidth=5)
33+
self.title('IDLE Preferences')
3334
self.geometry("+%d+%d" % (parent.winfo_rootx()+20,
3435
parent.winfo_rooty()+30))
3536
#Theme Elements. Each theme element key is its display name.

Lib/multiprocessing/pool.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ def map_async(self, func, iterable, chunksize=None, callback=None):
208208
chunksize, extra = divmod(len(iterable), len(self._pool) * 4)
209209
if extra:
210210
chunksize += 1
211+
if len(iterable) == 0:
212+
chunksize = 0
211213

212214
task_batches = Pool._get_tasks(func, iterable, chunksize)
213215
result = MapResult(self._cache, chunksize, len(iterable), callback)

Lib/test/test_kqueue.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,22 @@ def test_queue_event(self):
163163
server.close()
164164
serverSocket.close()
165165

166+
def testPair(self):
167+
kq = select.kqueue()
168+
a, b = socket.socketpair()
169+
170+
a.send(b'foo')
171+
event1 = select.kevent(a, select.KQ_FILTER_READ, select.KQ_EV_ADD | select.KQ_EV_ENABLE)
172+
event2 = select.kevent(b, select.KQ_FILTER_READ, select.KQ_EV_ADD | select.KQ_EV_ENABLE)
173+
r = kq.control([event1, event2], 1, 1)
174+
self.assertTrue(r)
175+
self.assertFalse(r[0].flags & select.KQ_EV_ERROR)
176+
self.assertEquals(b.recv(r[0].data), b'foo')
177+
178+
a.close()
179+
b.close()
180+
kq.close()
181+
166182
def test_main():
167183
support.run_unittest(TestKQueue)
168184

Lib/test/test_multiprocessing.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,12 @@ def test_map(self):
991991
self.assertEqual(pmap(sqr, list(range(100)), chunksize=20),
992992
list(map(sqr, list(range(100)))))
993993

994+
def test_map_chunksize(self):
995+
try:
996+
self.pool.map_async(sqr, [], chunksize=1).get(timeout=TIMEOUT1)
997+
except multiprocessing.TimeoutError:
998+
self.fail("pool.map_async with chunksize stalled on null list")
999+
9941000
def test_async(self):
9951001
res = self.pool.apply_async(sqr, (7, TIMEOUT1,))
9961002
get = TimingWrapper(res.get)

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ Walter D
199199
Hans Eckardt
200200
Grant Edwards
201201
John Ehresman
202+
Eric Eisner
202203
Andrew Eland
203204
Lance Ellinghaus
204205
David Ely

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,8 @@ Library
950950
- Issue #6459: distutils.command.build_ext.get_export_symbols now uses the
951951
"PyInit" prefix, rather than "init".
952952

953+
- Issue #6433: fixed issues with multiprocessing.pool.map hanging on empty list
954+
953955
- Issue #6455: Fixed test_build_ext under win32.
954956

955957
- Issue #6413: Fixed the log level in distutils.dist for announce.

Modules/selectmodule.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ kqueue_queue_control(kqueue_queue_Object *self, PyObject *args)
14921492
if (nevents < 0) {
14931493
PyErr_Format(PyExc_ValueError,
14941494
"Length of eventlist must be 0 or positive, got %d",
1495-
nchanges);
1495+
nevents);
14961496
return NULL;
14971497
}
14981498

@@ -1550,6 +1550,7 @@ kqueue_queue_control(kqueue_queue_Object *self, PyObject *args)
15501550
PyErr_NoMemory();
15511551
return NULL;
15521552
}
1553+
i = 0;
15531554
while ((ei = PyIter_Next(it)) != NULL) {
15541555
if (!kqueue_event_Check(ei)) {
15551556
Py_DECREF(ei);
@@ -1558,7 +1559,7 @@ kqueue_queue_control(kqueue_queue_Object *self, PyObject *args)
15581559
"select.kevent objects");
15591560
goto error;
15601561
} else {
1561-
chl[i] = ((kqueue_event_Object *)ei)->e;
1562+
chl[i++] = ((kqueue_event_Object *)ei)->e;
15621563
}
15631564
Py_DECREF(ei);
15641565
}
@@ -1589,7 +1590,7 @@ kqueue_queue_control(kqueue_queue_Object *self, PyObject *args)
15891590
goto error;
15901591
}
15911592

1592-
for (i=0; i < gotevents; i++) {
1593+
for (i = 0; i < gotevents; i++) {
15931594
kqueue_event_Object *ch;
15941595

15951596
ch = PyObject_New(kqueue_event_Object, &kqueue_event_Type);

0 commit comments

Comments
 (0)