Python and this documentation is:
-Copyright © 2001-2008 Python Software Foundation. All rights reserved.
+Copyright © 2001-2009 Python Software Foundation. All rights reserved.
Copyright © 2000 BeOpen.com. All rights reserved.
function, module or term in the index (in the back). And finally, if you enjoy
learning about random subjects, you choose a random page number (see module
:mod:`random`) and read a section or two. Regardless of the order in which you
-read the sections of this manual, it helps to start with chapter :ref:`builtin`,
-as the remainder of the manual assumes familiarity with this material.
+read the sections of this manual, it helps to start with chapter
+:ref:`built-in-funcs`, as the remainder of the manual assumes familiarity with
+this material.
Let the show begin!
sts = os.system("mycmd" + " myarg")
==>
p = Popen("mycmd" + " myarg", shell=True)
- sts = os.waitpid(p.pid, 0)
+ sts = os.waitpid(p.pid, 0)[1]
Notes:
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.
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)
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)
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)
Hans Eckardt
Grant Edwards
John Ehresman
+Eric Eisner
Andrew Eland
Lance Ellinghaus
David Ely
- Issue #6459: distutils.command.build_ext.get_export_symbols now uses the
"PyInit" prefix, rather than "init".
+- Issue #6433: fixed issues with multiprocessing.pool.map hanging on empty list
+
- Issue #6455: Fixed test_build_ext under win32.
- Issue #6413: Fixed the log level in distutils.dist for announce.
if (nevents < 0) {
PyErr_Format(PyExc_ValueError,
"Length of eventlist must be 0 or positive, got %d",
- nchanges);
+ nevents);
return NULL;
}
PyErr_NoMemory();
return NULL;
}
+ i = 0;
while ((ei = PyIter_Next(it)) != NULL) {
if (!kqueue_event_Check(ei)) {
Py_DECREF(ei);
"select.kevent objects");
goto error;
} else {
- chl[i] = ((kqueue_event_Object *)ei)->e;
+ chl[i++] = ((kqueue_event_Object *)ei)->e;
}
Py_DECREF(ei);
}
goto error;
}
- for (i=0; i < gotevents; i++) {
+ for (i = 0; i < gotevents; i++) {
kqueue_event_Object *ch;
ch = PyObject_New(kqueue_event_Object, &kqueue_event_Type);