From 68468eba635570400f607e140425a222018e56f9 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 27 Feb 2003 20:14:51 +0000 Subject: Get rid of many apply() calls. --- Lib/rexec.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Lib/rexec.py') diff --git a/Lib/rexec.py b/Lib/rexec.py index f7aa6402b0..203a1e9e73 100644 --- a/Lib/rexec.py +++ b/Lib/rexec.py @@ -48,7 +48,7 @@ class FileWrapper(FileBase): TEMPLATE = """ def %s(self, *args): - return apply(getattr(self.mod, self.name).%s, args) + return getattr(self.mod, self.name).%s(*args) """ class FileDelegate(FileBase): @@ -407,14 +407,11 @@ class RExec(ihooks._Verbose): sys.stdout = self.save_stdout sys.stderr = self.save_stderr - def s_apply(self, func, args=(), kw=None): + def s_apply(self, func, args=(), kw={}): self.save_files() try: self.set_files() - if kw: - r = apply(func, args, kw) - else: - r = apply(func, args) + r = func(*args, **kw) finally: self.restore_files() return r -- cgit v1.2.1