summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-09-25 18:47:39 (GMT)
committerGuido van Rossum <guido@python.org>1996-09-25 18:47:39 (GMT)
commite7b9fde1b8461b389f2bcc21350eb132a287f14b (patch)
tree3a274430d0160ef93fd2525f93e29fe97bdce26f /Lib
parent13bfbe77d61185ba460e28bdce8708c7abd68008 (diff)
downloadcpython-e7b9fde1b8461b389f2bcc21350eb132a287f14b.zip
cpython-e7b9fde1b8461b389f2bcc21350eb132a287f14b.tar.gz
cpython-e7b9fde1b8461b389f2bcc21350eb132a287f14b.tar.bz2
1. Correct typo in FileWrapper.close() (fix by AMK).
2. New trusted built-in modules cmath, errno, operator, parser. 3. Corrected bogus s_apply() -- the new one actually works (reported by AMK).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/rexec.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/Lib/rexec.py b/Lib/rexec.py
index 860aab2..76e8b40 100644
--- a/Lib/rexec.py
+++ b/Lib/rexec.py
@@ -41,7 +41,7 @@ class FileWrapper(FileBase):
if not hasattr(self, m):
setattr(self, m, getattr(f, m))
- def close(f):
+ def close(self):
self.flush()
@@ -131,9 +131,10 @@ class RExec(ihooks._Verbose):
ok_path = tuple(sys.path) # That's a policy decision
- ok_builtin_modules = ('array', 'binascii', 'audioop', 'imageop',
- 'marshal', 'math',
- 'md5', 'parser', 'regex', 'rotor', 'select',
+ ok_builtin_modules = ('audioop', 'array', 'binascii',
+ 'cmath', 'errno', 'imageop',
+ 'marshal', 'math', 'md5', 'operator',
+ 'parser', 'regex', 'rotor', 'select',
'strop', 'struct', 'time')
ok_posix_names = ('error', 'fstat', 'listdir', 'lstat', 'readlink',
@@ -320,11 +321,14 @@ class RExec(ihooks._Verbose):
sys.stdout = self.save_stdout
sys.stderr = self.save_stderr
- def s_apply(self, func, *args, **kw):
+ def s_apply(self, func, args=(), kw=None):
self.save_files()
try:
self.set_files()
- r = apply(func, args, kw)
+ if kw:
+ r = apply(func, args, kw)
+ else:
+ r = apply(func, args)
finally:
self.restore_files()