diff -r 360f9d483f94 -r 2a20cee18add Doc/library/multiprocessing.rst
--- a/Doc/library/multiprocessing.rst Mon Jun 18 19:57:23 2012 +0200
+++ b/Doc/library/multiprocessing.rst Mon Jun 18 08:33:13 2012 -0600
@@ -834,10 +834,6 @@
Connection objects themselves can now be transferred between processes
using :meth:`Connection.send` and :meth:`Connection.recv`.
- .. versionadded:: 3.3
- Connection objects now support the context manager protocol -- see
- :ref:`typecontextmanager`. :meth:`__enter__` returns the
- connection object, and :meth:`__exit__` calls :meth:`close`.
For example:
@@ -1281,9 +1277,6 @@
The address used by the manager.
- Manager objects support the context manager protocol -- see
- :ref:`typecontextmanager`. :meth:`__enter__` returns the
- manager object, and :meth:`__exit__` calls :meth:`shutdown`.
.. class:: SyncManager
@@ -1754,11 +1747,6 @@
Wait for the worker processes to exit. One must call :meth:`close` or
:meth:`terminate` before using :meth:`join`.
- .. versionadded:: 3.3
- Pool objects now support the context manager protocol -- see
- :ref:`typecontextmanager`. :meth:`__enter__` returns the pool
- object, and :meth:`__exit__` calls :meth:`terminate`.
-
.. class:: AsyncResult
@@ -1923,11 +1911,6 @@
The address from which the last accepted connection came. If this is
unavailable then it is ``None``.
- .. versionadded:: 3.3
- Listener objects now support the context manager protocol -- see
- :ref:`typecontextmanager`. :meth:`__enter__` returns the
- listener object, and :meth:`__exit__` calls :meth:`close`.
-
.. function:: wait(object_list, timeout=None)
Wait till an object in *object_list* is ready. Returns the list of
diff -r 360f9d483f94 -r 2a20cee18add Lib/multiprocessing/connection.py
--- a/Lib/multiprocessing/connection.py Mon Jun 18 19:57:23 2012 +0200
+++ b/Lib/multiprocessing/connection.py Mon Jun 18 08:33:13 2012 -0600
@@ -257,12 +257,6 @@
self._check_readable()
return self._poll(timeout)
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, exc_tb):
- self.close()
-
if _winapi:
@@ -442,8 +436,6 @@
Returns a `Connection` object.
'''
- if self._listener is None:
- raise IOError('listener is closed')
c = self._listener.accept()
if self._authkey:
deliver_challenge(c, self._authkey)
@@ -454,19 +446,11 @@
'''
Close the bound socket or named pipe of `self`.
'''
- if self._listener is not None:
- self._listener.close()
- self._listener = None
+ return self._listener.close()
address = property(lambda self: self._listener._address)
last_accepted = property(lambda self: self._listener._last_accepted)
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, exc_tb):
- self.close()
-
def Client(address, family=None, authkey=None):
'''
diff -r 360f9d483f94 -r 2a20cee18add Lib/multiprocessing/dummy/connection.py
--- a/Lib/multiprocessing/dummy/connection.py Mon Jun 18 19:57:23 2012 +0200
+++ b/Lib/multiprocessing/dummy/connection.py Mon Jun 18 08:33:13 2012 -0600
@@ -53,12 +53,6 @@
address = property(lambda self: self._backlog_queue)
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, exc_tb):
- self.close()
-
def Client(address):
_in, _out = Queue(), Queue()
@@ -91,9 +85,3 @@
def close(self):
pass
-
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, exc_tb):
- self.close()
diff -r 360f9d483f94 -r 2a20cee18add Lib/multiprocessing/pool.py
--- a/Lib/multiprocessing/pool.py Mon Jun 18 19:57:23 2012 +0200
+++ b/Lib/multiprocessing/pool.py Mon Jun 18 08:33:13 2012 -0600
@@ -496,8 +496,7 @@
# We must wait for the worker handler to exit before terminating
# workers because we don't want workers to be restarted behind our back.
debug('joining worker handler')
- if threading.current_thread() is not worker_handler:
- worker_handler.join()
+ worker_handler.join()
# Terminate workers which haven't already finished.
if pool and hasattr(pool[0], 'terminate'):
@@ -507,12 +506,10 @@
p.terminate()
debug('joining task handler')
- if threading.current_thread() is not task_handler:
- task_handler.join()
+ task_handler.join()
debug('joining result handler')
- if threading.current_thread() is not result_handler:
- result_handler.join()
+ result_handler.join()
if pool and hasattr(pool[0], 'terminate'):
debug('joining pool workers')
@@ -522,12 +519,6 @@
debug('cleaning up worker %d' % p.pid)
p.join()
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_val, exc_tb):
- self.terminate()
-
#
# Class whose instances are returned by `Pool.apply_async()`
#
diff -r 360f9d483f94 -r 2a20cee18add Lib/test/test_multiprocessing.py
--- a/Lib/test/test_multiprocessing.py Mon Jun 18 19:57:23 2012 +0200
+++ b/Lib/test/test_multiprocessing.py Mon Jun 18 08:33:13 2012 -0600
@@ -1719,15 +1719,6 @@
p.close()
p.join()
- def test_context(self):
- if self.TYPE == 'processes':
- L = list(range(10))
- expected = [sqr(i) for i in L]
- with multiprocessing.Pool(2) as p:
- r = p.map_async(sqr, L)
- self.assertEqual(r.get(), expected)
- self.assertRaises(AssertionError, p.map_async, sqr, L)
-
def raising():
raise KeyError("key")
@@ -2275,22 +2266,6 @@
self.assertRaises(RuntimeError, reduction.recv_handle, conn)
p.join()
- def test_context(self):
- a, b = self.Pipe()
-
- with a, b:
- a.send(1729)
- self.assertEqual(b.recv(), 1729)
- if self.TYPE == 'processes':
- self.assertFalse(a.closed)
- self.assertFalse(b.closed)
-
- if self.TYPE == 'processes':
- self.assertTrue(a.closed)
- self.assertTrue(b.closed)
- self.assertRaises(IOError, a.recv)
- self.assertRaises(IOError, b.recv)
-
class _TestListener(BaseTestCase):
ALLOWED_TYPES = ('processes',)
@@ -2302,16 +2277,6 @@
self.assertRaises(OSError, self.connection.Listener,
l.address, family)
- def test_context(self):
- with self.connection.Listener() as l:
- with self.connection.Client(l.address) as c:
- with l.accept() as d:
- c.send(1729)
- self.assertEqual(d.recv(), 1729)
-
- if self.TYPE == 'processes':
- self.assertRaises(IOError, l.accept)
-
class _TestListenerClient(BaseTestCase):
ALLOWED_TYPES = ('processes', 'threads')
diff -r 360f9d483f94 -r 2a20cee18add Misc/NEWS
--- a/Misc/NEWS Mon Jun 18 19:57:23 2012 +0200
+++ b/Misc/NEWS Mon Jun 18 08:33:13 2012 -0600
@@ -29,10 +29,6 @@
Library
-------
-- Issue #15064: Implement context manager protocol for multiprocessing types
-
-- Issue #15101: Make pool finalizer avoid joining current thread.
-
- Issue #14657: The frozen instance of importlib used for bootstrap is now
also the module imported as importlib._bootstrap.
diff -r 360f9d483f94 -r 2a20cee18add Modules/_decimal/libmpdec/mpdecimal.c
--- a/Modules/_decimal/libmpdec/mpdecimal.c Mon Jun 18 19:57:23 2012 +0200
+++ b/Modules/_decimal/libmpdec/mpdecimal.c Mon Jun 18 08:33:13 2012 -0600
@@ -5984,10 +5984,8 @@
mpd_qfinalize(result, ctx, status);
}
-/*
- * If the exponent is infinite and base equals one, the result is one
- * with a coefficient of length prec. Otherwise, result is undefined.
- * Return the value of the comparison against one.
+/*
+ * This is an internal function that does not check for NaNs.
*/
static int
_qcheck_pow_one_inf(mpd_t *result, const mpd_t *base, uint8_t resultsign,
@@ -6008,7 +6006,7 @@
}
/*
- * If abs(base) equals one, calculate the correct power of one result.
+ * If base equals one, calculate the correct power of one result.
* Otherwise, result is undefined. Return the value of the comparison
* against 1.
*
@@ -6062,7 +6060,7 @@
/*
* Detect certain over/underflow of x**y.
- * ACL2 proof: pow-bounds.lisp.
+ * ACL2 proof: pow_bounds.lisp.
*
* Symbols:
*
@@ -6217,10 +6215,7 @@
}
*/
-/*
- * The power function for real exponents.
- * Relative error: abs(result - e**y) < e**y * 1/5 * 10**(-prec - 1) - */ +/* The power function for real exponents */ static void _mpd_qpow_real(mpd_t *result, const mpd_t *base, const mpd_t *exp, const mpd_context_t *ctx, uint32_t *status) @@ -6239,30 +6234,6 @@ workctx.round = MPD_ROUND_HALF_EVEN; workctx.allcr = ctx->allcr;
- /*
- * extra := MPD_EXPDIGITS = MPD_EXP_MAX_T
- * wp := prec + 4 + extra
- * abs(err) < 5 * 10**-wp - * y := log(base) * exp - * Calculate: - * 1) e**(y * (1 + err)**2) * (1 + err) - * = e**y * e**(y * (2*err + err**2)) * (1 + err) - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * Relative error of the underlined term: - * 2) abs(e**(y * (2*err + err**2)) - 1) - * Case abs(y)>= 10**extra:
- * 3) adjexp(y)+1> log10(abs(y))>= extra
- * This triggers the Overflow/Underflow shortcut in _mpd_qexp(),
- * so no further analysis is necessary.
- * Case abs(y) < 10**extra: - * 4) abs(y * (2*err + err**2)) < 1/5 * 10**(-prec - 2) - * Use (see _mpd_qexp): - * 5) abs(x) <= 9/10 * 10**-p ==> abs(e**x - 1) < 10**-p - * With 2), 4) and 5): - * 6) abs(e**(y * (2*err + err**2)) - 1) < 10**(-prec - 2) - * The complete relative error of 1) is: - * 7) abs(result - e**y) < e**y * 1/5 * 10**(-prec - 1) - */ mpd_qln(result, base, &workctx, &workctx.status); mpd_qmul(result, result, &texp, &workctx, &workctx.status); mpd_qexp(result, result, &workctx, status); diff -r 360f9d483f94 -r 2a20cee18add PC/python_nt.rc --- a/PC/python_nt.rc Mon Jun 18 19:57:23 2012 +0200 +++ b/PC/python_nt.rc Mon Jun 18 08:33:13 2012 -0600 @@ -6,11 +6,7 @@ #define MS_WINDOWS #include "modsupport.h" #include "patchlevel.h" -#ifdef _DEBUG -# include "pythonnt_rc_d.h" -#else -# include "pythonnt_rc.h" -#endif +#include "pythonnt_rc.h" /* e.g., 3.3.0a1 * PY_VERSION comes from patchevel.h diff -r 360f9d483f94 -r 2a20cee18add PCbuild/make_versioninfo.vcxproj --- a/PCbuild/make_versioninfo.vcxproj Mon Jun 18 19:57:23 2012 +0200 +++ b/PCbuild/make_versioninfo.vcxproj Mon Jun 18 08:33:13 2012 -0600 @@ -1,199 +1,70 @@ -
-