diff options
Diffstat (limited to 'Demo/threads')
-rw-r--r-- | Demo/threads/Coroutine.py | 2 | ||||
-rw-r--r-- | Demo/threads/Generator.py | 2 | ||||
-rw-r--r-- | Demo/threads/find.py | 5 |
3 files changed, 4 insertions, 5 deletions
diff --git a/Demo/threads/Coroutine.py b/Demo/threads/Coroutine.py index 4cc65f7bf8..10fa303f13 100644 --- a/Demo/threads/Coroutine.py +++ b/Demo/threads/Coroutine.py @@ -115,7 +115,7 @@ class Coroutine: if not self.killed: try: try: - apply(me.f, args) + me.f(*args) except Killed: pass finally: diff --git a/Demo/threads/Generator.py b/Demo/threads/Generator.py index a2713af1a1..63bed9b905 100644 --- a/Demo/threads/Generator.py +++ b/Demo/threads/Generator.py @@ -22,7 +22,7 @@ class Generator: self.putlock.acquire() if not self.killed: try: - apply(self.func, (self,) + self.args) + self.func(self, *self.args) except Killed: pass finally: diff --git a/Demo/threads/find.py b/Demo/threads/find.py index 7d5edc1c50..14148b8bb9 100644 --- a/Demo/threads/find.py +++ b/Demo/threads/find.py @@ -17,7 +17,6 @@ import sys import getopt -import string import time import os from stat import * @@ -85,7 +84,7 @@ class WorkQ: if not job: break func, args = job - apply(func, args) + func(*args) self._donework() def run(self, nworkers): @@ -104,7 +103,7 @@ def main(): opts, args = getopt.getopt(sys.argv[1:], '-w:') for opt, arg in opts: if opt == '-w': - nworkers = string.atoi(arg) + nworkers = int(arg) if not args: args = [os.curdir] |