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
fc1b6f00
Commit
fc1b6f00
authored
Jan 18, 2012
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the _io module leaking references when a sub-interpreter is created.
parent
1c7ade52
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
48 deletions
+36
-48
Modules/_io/_iomodule.c
Modules/_io/_iomodule.c
+36
-48
No files found.
Modules/_io/_iomodule.c
View file @
fc1b6f00
...
...
@@ -741,58 +741,46 @@ PyInit__io(void)
ADD_TYPE
(
&
PyIncrementalNewlineDecoder_Type
,
"IncrementalNewlineDecoder"
);
/* Interned strings */
if
(
!
(
_PyIO_str_close
=
PyUnicode_InternFromString
(
"close"
)))
#define ADD_INTERNED(name) \
if (!_PyIO_str_ ## name && \
!(_PyIO_str_ ## name = PyUnicode_InternFromString(# name))) \
goto fail;
if
(
!
(
_PyIO_str_closed
=
PyUnicode_InternFromString
(
"closed"
)))
goto
fail
;
if
(
!
(
_PyIO_str_decode
=
PyUnicode_InternFromString
(
"decode"
)))
goto
fail
;
if
(
!
(
_PyIO_str_encode
=
PyUnicode_InternFromString
(
"encode"
)))
goto
fail
;
if
(
!
(
_PyIO_str_fileno
=
PyUnicode_InternFromString
(
"fileno"
)))
goto
fail
;
if
(
!
(
_PyIO_str_flush
=
PyUnicode_InternFromString
(
"flush"
)))
goto
fail
;
if
(
!
(
_PyIO_str_getstate
=
PyUnicode_InternFromString
(
"getstate"
)))
goto
fail
;
if
(
!
(
_PyIO_str_isatty
=
PyUnicode_InternFromString
(
"isatty"
)))
goto
fail
;
if
(
!
(
_PyIO_str_newlines
=
PyUnicode_InternFromString
(
"newlines"
)))
goto
fail
;
if
(
!
(
_PyIO_str_nl
=
PyUnicode_InternFromString
(
"
\n
"
)))
goto
fail
;
if
(
!
(
_PyIO_str_read
=
PyUnicode_InternFromString
(
"read"
)))
goto
fail
;
if
(
!
(
_PyIO_str_read1
=
PyUnicode_InternFromString
(
"read1"
)))
goto
fail
;
if
(
!
(
_PyIO_str_readable
=
PyUnicode_InternFromString
(
"readable"
)))
goto
fail
;
if
(
!
(
_PyIO_str_readinto
=
PyUnicode_InternFromString
(
"readinto"
)))
goto
fail
;
if
(
!
(
_PyIO_str_readline
=
PyUnicode_InternFromString
(
"readline"
)))
goto
fail
;
if
(
!
(
_PyIO_str_reset
=
PyUnicode_InternFromString
(
"reset"
)))
goto
fail
;
if
(
!
(
_PyIO_str_seek
=
PyUnicode_InternFromString
(
"seek"
)))
goto
fail
;
if
(
!
(
_PyIO_str_seekable
=
PyUnicode_InternFromString
(
"seekable"
)))
goto
fail
;
if
(
!
(
_PyIO_str_setstate
=
PyUnicode_InternFromString
(
"setstate"
)))
goto
fail
;
if
(
!
(
_PyIO_str_tell
=
PyUnicode_InternFromString
(
"tell"
)))
goto
fail
;
if
(
!
(
_PyIO_str_truncate
=
PyUnicode_InternFromString
(
"truncate"
)))
goto
fail
;
if
(
!
(
_PyIO_str_write
=
PyUnicode_InternFromString
(
"write"
)))
goto
fail
;
if
(
!
(
_PyIO_str_writable
=
PyUnicode_InternFromString
(
"writable"
)))
ADD_INTERNED
(
close
)
ADD_INTERNED
(
closed
)
ADD_INTERNED
(
decode
)
ADD_INTERNED
(
encode
)
ADD_INTERNED
(
fileno
)
ADD_INTERNED
(
flush
)
ADD_INTERNED
(
getstate
)
ADD_INTERNED
(
isatty
)
ADD_INTERNED
(
newlines
)
ADD_INTERNED
(
read
)
ADD_INTERNED
(
read1
)
ADD_INTERNED
(
readable
)
ADD_INTERNED
(
readinto
)
ADD_INTERNED
(
readline
)
ADD_INTERNED
(
reset
)
ADD_INTERNED
(
seek
)
ADD_INTERNED
(
seekable
)
ADD_INTERNED
(
setstate
)
ADD_INTERNED
(
tell
)
ADD_INTERNED
(
truncate
)
ADD_INTERNED
(
write
)
ADD_INTERNED
(
writable
)
if
(
!
_PyIO_str_nl
&&
!
(
_PyIO_str_nl
=
PyUnicode_InternFromString
(
"
\n
"
)))
goto
fail
;
if
(
!
(
_PyIO_empty_str
=
PyUnicode_FromStringAndSize
(
NULL
,
0
)))
if
(
!
_PyIO_empty_str
&&
!
(
_PyIO_empty_str
=
PyUnicode_FromStringAndSize
(
NULL
,
0
)))
goto
fail
;
if
(
!
(
_PyIO_empty_bytes
=
PyBytes_FromStringAndSize
(
NULL
,
0
)))
if
(
!
_PyIO_empty_bytes
&&
!
(
_PyIO_empty_bytes
=
PyBytes_FromStringAndSize
(
NULL
,
0
)))
goto
fail
;
if
(
!
(
_PyIO_zero
=
PyLong_FromLong
(
0L
)))
if
(
!
_PyIO_zero
&&
!
(
_PyIO_zero
=
PyLong_FromLong
(
0L
)))
goto
fail
;
state
->
initialized
=
1
;
...
...
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