diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-09-13 21:01:29 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-09-13 21:01:29 (GMT) |
commit | 8fa45677c1833cc0d4ddaa57417c01ee8297eba8 (patch) | |
tree | e33c30313a1f60475f2e7b1e5db33901398398ab /Lib/rexec.py | |
parent | 561f899d198c74516f0911a415f2914af3890576 (diff) | |
download | cpython-8fa45677c1833cc0d4ddaa57417c01ee8297eba8.zip cpython-8fa45677c1833cc0d4ddaa57417c01ee8297eba8.tar.gz cpython-8fa45677c1833cc0d4ddaa57417c01ee8297eba8.tar.bz2 |
Now that file objects are subclassable, you can get at the file constructor
just by doing type(f) where f is any file object. This left a hole in
restricted execution mode that rexec.py can't plug by itself (although it
can plug part of it; the rest is plugged in fileobject.c now).
Diffstat (limited to 'Lib/rexec.py')
-rw-r--r-- | Lib/rexec.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/rexec.py b/Lib/rexec.py index d1dd4eb..cece544 100644 --- a/Lib/rexec.py +++ b/Lib/rexec.py @@ -132,7 +132,7 @@ class RExec(ihooks._Verbose): ok_sys_names = ('ps1', 'ps2', 'copyright', 'version', 'platform', 'exit', 'maxint') - nok_builtin_names = ('open', 'reload', '__import__') + nok_builtin_names = ('open', 'file', 'reload', '__import__') def __init__(self, hooks = None, verbose = 0): ihooks._Verbose.__init__(self, verbose) @@ -186,7 +186,7 @@ class RExec(ihooks._Verbose): m = self.copy_except(__builtin__, self.nok_builtin_names) m.__import__ = self.r_import m.reload = self.r_reload - m.open = self.r_open + m.open = m.file = self.r_open def make_main(self): m = self.add_module('__main__') |