mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
2to3 run of multiprocessing examples.
mp_benchmarks, mp_newtypes and mp_distribution are still broken but the others are working properly. We should include the examples in our unit test suite ...
This commit is contained in:
parent
94e0772989
commit
aae1b70a83
6 changed files with 177 additions and 177 deletions
|
@ -13,8 +13,8 @@ import os
|
|||
import sys
|
||||
|
||||
from multiprocessing import Process, current_process, freeze_support
|
||||
from BaseHTTPServer import HTTPServer
|
||||
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||
from http.server import HTTPServer
|
||||
from http.server import SimpleHTTPRequestHandler
|
||||
|
||||
if sys.platform == 'win32':
|
||||
import multiprocessing.reduction # make sockets pickable/inheritable
|
||||
|
@ -54,9 +54,9 @@ def test():
|
|||
ADDRESS = ('localhost', 8000)
|
||||
NUMBER_OF_PROCESSES = 4
|
||||
|
||||
print 'Serving at http://%s:%d using %d worker processes' % \
|
||||
(ADDRESS[0], ADDRESS[1], NUMBER_OF_PROCESSES)
|
||||
print 'To exit press Ctrl-' + ['C', 'Break'][sys.platform=='win32']
|
||||
print('Serving at http://%s:%d using %d worker processes' % \
|
||||
(ADDRESS[0], ADDRESS[1], NUMBER_OF_PROCESSES))
|
||||
print('To exit press Ctrl-' + ['C', 'Break'][sys.platform=='win32'])
|
||||
|
||||
os.chdir(DIR)
|
||||
runpool(ADDRESS, NUMBER_OF_PROCESSES)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue