|
12 | 12 |
|
13 | 13 | """ |
14 | 14 |
|
15 | | -import sys, os, string, getopt, thread, socket, traceback |
| 15 | +import sys, os, string, getopt, _thread, socket, traceback |
16 | 16 |
|
17 | 17 | PORT = 4000 # Default port |
18 | 18 |
|
@@ -52,17 +52,17 @@ def main_thread(port): |
52 | 52 | conn.close() |
53 | 53 | print("Refusing connection from non-local host", addr[0], ".") |
54 | 54 | continue |
55 | | - thread.start_new_thread(service_thread, (conn, addr)) |
| 55 | + _thread.start_new_thread(service_thread, (conn, addr)) |
56 | 56 | del conn, addr |
57 | 57 |
|
58 | 58 | def service_thread(conn, addr): |
59 | 59 | (caddr, cport) = addr |
60 | | - print("Thread %s has connection from %s.\n" % (str(thread.get_ident()), |
| 60 | + print("Thread %s has connection from %s.\n" % (str(_thread.get_ident()), |
61 | 61 | caddr), end=' ') |
62 | 62 | stdin = conn.makefile("r") |
63 | 63 | stdout = conn.makefile("w", 0) |
64 | 64 | run_interpreter(stdin, stdout) |
65 | | - print("Thread %s is done.\n" % str(thread.get_ident()), end=' ') |
| 65 | + print("Thread %s is done.\n" % str(_thread.get_ident()), end=' ') |
66 | 66 |
|
67 | 67 | def run_interpreter(stdin, stdout): |
68 | 68 | globals = {} |
|
0 commit comments