cp -rf Python-2.7.10/Modules/_multiprocessing Modules/_multiprocessing
cp -rf Python-2.7.10/Lib/multiprocessing multiprocessing
cp -rf Python-2.7.10/Lib/test/test_multiprocessing.py tests/__init__.py
cp -rf py2.5.6/examples .
cp -f py2.5.6/*txt .
cp -f billiard-3.3.0.20/setup.py .
cp -rf py2.5.6/doc .
cp -f py2.5.6/index.html .

# ----------------------------------------------------------------------
CHANGES TO setup.py:
  HACKED billiard's setup.py together with processing's setup.py

CHANGES TO examples:
  updated from old (processing) to new (multiprocessing) methods
# ----------------------------------------------------------------------
diff Modules/_multiprocessing/semaphore.c Python-2.7.10/Modules/_multiprocessing/semaphore.c
211c211
< //ifndef HAVE_SEM_TIMEDWAIT
---
> #ifndef HAVE_SEM_TIMEDWAIT
272c272
< //endif /* !HAVE_SEM_TIMEDWAIT */
---
> #endif /* !HAVE_SEM_TIMEDWAIT */

# ----------------------------------------------------------------------
diff multiprocessing/__init__.py Python-2.7.10/Lib/multiprocessing/__init__.py
44c44
< __version__ = '0.70.1'
---
> __version__ = '0.70a1'

diff tests/__init__.py Python-2.7.10/Lib/test/test_multiprocessing.py 
2474c2474
<     def _test_noforkbomb(self):
---
>     def test_noforkbomb(self):

diff multiprocessing/forking.py Python-2.7.10/Lib/multiprocessing/forking.py
59,62c59
< try:
<     from dill import Pickler
< except ImportError:
<     from pickle import Pickler
---
> from pickle import Pickler
196,200c193,196
<     try:
<     #   from cPickle import dump, load, HIGHEST_PROTOCOL
<         from dill import load, DEFAULT_PROTOCOL as HIGHEST_PROTOCOL
<     except ImportError:
<         from pickle import load, HIGHEST_PROTOCOL
---
>     #try:
>     #    from cPickle import dump, load, HIGHEST_PROTOCOL
>     #except ImportError:
>     from pickle import load, HIGHEST_PROTOCOL

diff multiprocessing/managers.py Python-2.7.10/Lib/multiprocessing/managers.py
56c56
<     from dill import PicklingError
---
>     from cPickle import PicklingError
58,61c58
<     try:
<         from cPickle import PicklingError
<     except ImportError:
<         from pickle import PicklingError
---
>     from pickle import PicklingError

diff Modules/_multiprocessing/multiprocessing.c Python-2.7.10/Modules/_multiprocessing/multiprocessing.c
255,257c255
<     temp = PyImport_ImportModule("dill");
<     if (!temp)
<         temp = PyImport_ImportModule(PICKLE_MODULE);
---
>     temp = PyImport_ImportModule(PICKLE_MODULE);
262,264c260
<     pickle_protocol = PyObject_GetAttrString(temp, "DEFAULT_PROTOCOL");
<     if (!pickle_protocol)
<         pickle_protocol = PyObject_GetAttrString(temp, "HIGHEST_PROTOCOL");
---
>     pickle_protocol = PyObject_GetAttrString(temp, "HIGHEST_PROTOCOL");

# ----------------------------------------------------------------------
REPLACED "from multiprocessing" with "from multiprocess"
REPLACED "from _multiprocessing" with "from _multiprocess"
REPLACED "import _multiprocessing" with "import _multiprocess as _multiprocessing"
REPLACED "multprocessing" with "multiprocess" wherever else relevant...

# ----------------------------------------------------------------------
diff Python-2.7.10/Modules/_multiprocessing/connection.h Python-2.7.13/Modules/_multiprocessing/connection.h
22,23c22,23
<     PyErr_SetString(PyExc_IOError, "connection is write-only"); \
<     return NULL; \
---
>         PyErr_SetString(PyExc_IOError, "connection is write-only"); \
>         return NULL; \
28,29c28,29
<     PyErr_SetString(PyExc_IOError, "connection is read-only"); \
<     return NULL; \
---
>         PyErr_SetString(PyExc_IOError, "connection is read-only"); \
>         return NULL; \

diff Python-2.7.10/Modules/_multiprocessing/semaphore.c Python-2.7.13/Modules/_multiprocessing/semaphore.c
432c432
<     static int counter = 0;
---
>     int try = 0;
443c443,453
<     PyOS_snprintf(buffer, sizeof(buffer), "/mp%ld-%d", (long)getpid(), counter++);
---
>     /* Create a semaphore with a unique name. The bytes returned by
>      * _PyOS_URandom() are treated as unsigned long to ensure that the filename
>      * is valid (no special characters). */
>     do {
>         unsigned long suffix;
>         _PyOS_URandom((char *)&suffix, sizeof(suffix));
>         PyOS_snprintf(buffer, sizeof(buffer), "/mp%ld-%lu", (long)getpid(),
>                       suffix);
>         SEM_CLEAR_ERROR();
>         handle = SEM_CREATE(buffer, value, maxvalue);
>     } while ((handle == SEM_FAILED) && (errno == EEXIST) && (++try < 100));
445,446d454
<     SEM_CLEAR_ERROR();
<     handle = SEM_CREATE(buffer, value, maxvalue);

diff Python-2.7.10/Lib/multiprocessing/forking.py Python-2.7.13/Lib/multiprocessing/forking.py
472a473,478
>         # XXX (ncoghlan): The following code makes several bogus
>         # assumptions regarding the relationship between __file__
>         # and a module's real name. See PEP 302 and issue #10845
>         # The problem is resolved properly in Python 3.4+, as
>         # described in issue #19946
> 
478c484,492
<         if main_name != 'ipython':
---
>         if main_name == '__main__':
>             # For directory and zipfile execution, we assume an implicit
>             # "if __name__ == '__main__':" around the module, and don't
>             # rerun the main module code in spawned processes
>             main_module = sys.modules['__main__']
>             main_module.__file__ = main_path
>         elif main_name != 'ipython':
>             # Main modules not actually called __main__.py may
>             # contain additional code that should still be executed

diff Python-2.7.10/Lib/multiprocessing/managers.py Python-2.7.13/Lib/multiprocessing/managers.py
290c290
<                     send(('#UNSERIALIZABLE', repr(msg)))
---
>                     send(('#UNSERIALIZABLE', format_exc()))
887c887
<     Return an proxy type whose methods are given by `exposed`
---
>     Return a proxy type whose methods are given by `exposed`
# ----------------------------------------------------------------------
diff Python-2.7.13/Lib/multiprocessing/forking.py Python-2.7.15/Lib/multiprocessing/forking.py
408c408,409
<         if not WINEXE and not WINSERVICE:
---
>         if not WINEXE and not WINSERVICE and \
>            not d['sys_argv'][0].lower().endswith('pythonservice.exe'):
diff Python-2.7.13/Lib/multiprocessing/pool.py Python-2.7.15/Lib/multiprocessing/pool.py
89c89
<     assert maxtasks is None or (type(maxtasks) == int and maxtasks > 0)
---
>     assert maxtasks is None or (type(maxtasks) in (int, long) and maxtasks > 0)
122a123,124
> 
>         task = job = result = func = args = kwds = None
364a367,368
>             finally:
>                 task = taskseq = job = None
368d371
< 
407a411
>             task = job = obj = None
423a428
>             task = job = obj = None
diff Python-2.7.13/Lib/multiprocessing/process.py Python-2.7.15/Lib/multiprocessing/process.py
130a131,133
>         # Avoid a refcycle if the target function holds an indirect
>         # reference to the process object (see bpo-30775)
>         del self._target, self._args, self._kwargs
155a159
> 
158,159c162,168
<         self._popen.poll()
<         return self._popen.returncode is None
---
> 
>         returncode = self._popen.poll()
>         if returncode is None:
>             return True
>         else:
>             _current_process._children.discard(self)
>             return False
230c239
<         if type(status) is int:
---
>         if type(status) in (int, long):
265,266c274,275
<             elif isinstance(e.args[0], int):
<                 exitcode = e.args[0]
---
>             elif isinstance(e.args[0], (int, long)):
>                 exitcode = int(e.args[0])
diff Python-2.7.13/Lib/multiprocessing/queues.py Python-2.7.15/Lib/multiprocessing/queues.py
131c131
<                     if timeout < 0 or not self._poll(timeout):
---
>                     if not self._poll(timeout):
247,248c247,248
<         try:
<             while 1:
---
>         while 1:
>             try:
273,278c273,277
<         except Exception, e:
<             # Since this runs in a daemon thread the resources it uses
<             # may be become unusable while the process is cleaning up.
<             # We ignore errors which happen after the process has
<             # started to cleanup.
<             try:
---
>             except Exception as e:
>                 # Since this runs in a daemon thread the resources it uses
>                 # may be become unusable while the process is cleaning up.
>                 # We ignore errors which happen after the process has
>                 # started to cleanup.
280a280
>                     return
284,285d283
<             except Exception:
<                 pass
diff Python-2.7.13/Lib/multiprocessing/util.py Python-2.7.15/Lib/multiprocessing/util.py
177c177
<         assert exitpriority is None or type(exitpriority) is int
---
>         assert exitpriority is None or type(exitpriority) in (int, long)
267a268,270
>     # Careful: _finalizer_registry may be mutated while this function
>     # is running (either by a GC run or by another thread).
> 

