diff options
author | Guido van Rossum <guido@python.org> | 2003-02-27 20:14:51 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2003-02-27 20:14:51 (GMT) |
commit | 68468eba635570400f607e140425a222018e56f9 (patch) | |
tree | 2176c8822392383a88caa0a2209a1d2f3446d45c /Lib/rexec.py | |
parent | f389c7727362321a91dbaff13b7e1cef6cbaa3d8 (diff) | |
download | cpython-68468eba635570400f607e140425a222018e56f9.zip cpython-68468eba635570400f607e140425a222018e56f9.tar.gz cpython-68468eba635570400f607e140425a222018e56f9.tar.bz2 |
Get rid of many apply() calls.
Diffstat (limited to 'Lib/rexec.py')
-rw-r--r-- | Lib/rexec.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/rexec.py b/Lib/rexec.py index f7aa640..203a1e9 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 |