summaryrefslogtreecommitdiff
path: root/Demo
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-25 13:05:15 +0000
committerGeorg Brandl <georg@python.org>2008-05-25 13:05:15 +0000
commit2067bfdf253e134a4144d3747300dbfcc7cc6203 (patch)
tree76613f07319d07cc4f0159769131a051504f8c69 /Demo
parent3b4b45bfe546b023383d4382af7767359390e264 (diff)
downloadcpython-git-2067bfdf253e134a4144d3747300dbfcc7cc6203.tar.gz
Rename thread to _thread and dummy_thread to _dummy_thread. Issue #2875.
Diffstat (limited to 'Demo')
-rw-r--r--Demo/metaclasses/Synch.py2
-rwxr-xr-xDemo/pysvr/pysvr.py8
-rw-r--r--Demo/threads/Coroutine.py2
-rw-r--r--Demo/threads/Generator.py2
-rw-r--r--Demo/threads/find.py2
-rw-r--r--Demo/threads/sync.py2
-rw-r--r--Demo/threads/telnet.py2
7 files changed, 10 insertions, 10 deletions
diff --git a/Demo/metaclasses/Synch.py b/Demo/metaclasses/Synch.py
index 445ce83480..e02f88f622 100644
--- a/Demo/metaclasses/Synch.py
+++ b/Demo/metaclasses/Synch.py
@@ -4,7 +4,7 @@ This metaclass makes it possible to declare synchronized methods.
"""
-import thread
+import _thread as thread
# First we need to define a reentrant lock.
# This is generally useful and should probably be in a standard Python
diff --git a/Demo/pysvr/pysvr.py b/Demo/pysvr/pysvr.py
index b200fade48..3e94dbe05c 100755
--- a/Demo/pysvr/pysvr.py
+++ b/Demo/pysvr/pysvr.py
@@ -12,7 +12,7 @@ can log in on your machine. Use with caution!
"""
-import sys, os, string, getopt, thread, socket, traceback
+import sys, os, string, getopt, _thread, socket, traceback
PORT = 4000 # Default port
@@ -52,17 +52,17 @@ def main_thread(port):
conn.close()
print("Refusing connection from non-local host", addr[0], ".")
continue
- thread.start_new_thread(service_thread, (conn, addr))
+ _thread.start_new_thread(service_thread, (conn, addr))
del conn, addr
def service_thread(conn, addr):
(caddr, cport) = addr
- print("Thread %s has connection from %s.\n" % (str(thread.get_ident()),
+ print("Thread %s has connection from %s.\n" % (str(_thread.get_ident()),
caddr), end=' ')
stdin = conn.makefile("r")
stdout = conn.makefile("w", 0)
run_interpreter(stdin, stdout)
- print("Thread %s is done.\n" % str(thread.get_ident()), end=' ')
+ print("Thread %s is done.\n" % str(_thread.get_ident()), end=' ')
def run_interpreter(stdin, stdout):
globals = {}
diff --git a/Demo/threads/Coroutine.py b/Demo/threads/Coroutine.py
index 4a155f89ae..e7d882dfc5 100644
--- a/Demo/threads/Coroutine.py
+++ b/Demo/threads/Coroutine.py
@@ -66,7 +66,7 @@
# current implementation consumes a thread for each coroutine that
# may be resumed.
-import thread
+import _thread as thread
import sync
class _CoEvent:
diff --git a/Demo/threads/Generator.py b/Demo/threads/Generator.py
index 0cc1bda348..38c0c8adb8 100644
--- a/Demo/threads/Generator.py
+++ b/Demo/threads/Generator.py
@@ -1,6 +1,6 @@
# Generator implementation using threads
-import thread
+import _thread as thread
Killed = 'Generator.Killed'
diff --git a/Demo/threads/find.py b/Demo/threads/find.py
index 57fe81e380..2b4ef7dec0 100644
--- a/Demo/threads/find.py
+++ b/Demo/threads/find.py
@@ -20,7 +20,7 @@ import getopt
import time
import os
from stat import *
-import thread
+import _thread as thread
# Work queue class. Usage:
diff --git a/Demo/threads/sync.py b/Demo/threads/sync.py
index 61e16287e4..90fff2e49d 100644
--- a/Demo/threads/sync.py
+++ b/Demo/threads/sync.py
@@ -268,7 +268,7 @@
# if there are are no threads waiting to write. (This is a
# weakness of the interface!)
-import thread
+import _thread as thread
class condition:
def __init__(self, lock=None):
diff --git a/Demo/threads/telnet.py b/Demo/threads/telnet.py
index 7366341232..dfe4905569 100644
--- a/Demo/threads/telnet.py
+++ b/Demo/threads/telnet.py
@@ -15,7 +15,7 @@
import sys, os, time
from socket import *
-import thread
+import _thread as thread
BUFSIZE = 8*1024