Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
bebe5157
Commit
bebe5157
authored
Aug 09, 1995
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add module binascii; add r_unload/s_unload; don't change 'rb' to 'r' in open
parent
aa763447
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Lib/rexec.py
Lib/rexec.py
+9
-2
No files found.
Lib/rexec.py
View file @
bebe5157
...
...
@@ -112,7 +112,8 @@ class RExec(ihooks._Verbose):
ok_path
=
tuple
(
sys
.
path
)
# That's a policy decision
ok_builtin_modules
=
(
'array'
,
'audioop'
,
'imageop'
,
'marshal'
,
'math'
,
ok_builtin_modules
=
(
'array'
,
'binascii'
,
'audioop'
,
'imageop'
,
'marshal'
,
'math'
,
'md5'
,
'parser'
,
'regex'
,
'rotor'
,
'select'
,
'strop'
,
'struct'
,
'time'
)
...
...
@@ -229,6 +230,9 @@ class RExec(ihooks._Verbose):
def
r_reload
(
self
,
m
):
return
self
.
importer
.
reload
(
m
)
def
r_unload
(
self
,
m
):
return
self
.
importer
.
unload
(
m
)
# The s_* methods are similar but also swap std{in,out,err}
...
...
@@ -274,12 +278,15 @@ class RExec(ihooks._Verbose):
def
s_reload
(
self
,
*
args
):
self
.
s_apply
(
self
.
r_reload
,
args
)
def
s_unload
(
self
,
*
args
):
self
.
s_apply
(
self
.
r_unload
,
args
)
# Restricted open(...)
def
r_open
(
self
,
file
,
mode
=
'r'
,
buf
=-
1
):
if
mode
not
in
(
'r'
,
'rb'
):
raise
IOError
,
"can't open files for writing in restricted mode"
return
open
(
file
,
'r'
,
buf
)
return
open
(
file
,
mode
,
buf
)
def
test
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment