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
dea76376
Commit
dea76376
authored
May 08, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #23815: Fixed crashes related to directly created instances of types in
_tkinter and curses.panel modules.
parents
1ce738e0
e3f1b091
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
3 deletions
+16
-3
Lib/test/test_curses.py
Lib/test/test_curses.py
+4
-0
Lib/test/test_tcl.py
Lib/test/test_tcl.py
+2
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_curses_panel.c
Modules/_curses_panel.c
+4
-3
Modules/_tkinter.c
Modules/_tkinter.c
+3
-0
No files found.
Lib/test/test_curses.py
View file @
dea76376
...
...
@@ -285,6 +285,10 @@ class TestCurses(unittest.TestCase):
panel
.
set_userptr
(
A
())
panel
.
set_userptr
(
None
)
def
test_new_curses_panel
(
self
):
panel
=
curses
.
panel
.
new_panel
(
self
.
stdscr
)
self
.
assertRaises
(
TypeError
,
type
(
panel
))
@
unittest
.
skipUnless
(
hasattr
(
curses
,
'resizeterm'
),
'resizeterm not available'
)
def
test_resize_term
(
self
):
...
...
Lib/test/test_tcl.py
View file @
dea76376
...
...
@@ -649,6 +649,8 @@ class TclTest(unittest.TestCase):
expected = {'
a
': (1, 2, 3), '
something
': '
foo
', '
status
': ''}
self.assertEqual(splitdict(tcl, arg), expected)
def test_new_tcl_obj(self):
self.assertRaises(TypeError, _tkinter.Tcl_Obj)
class BigmemTclTest(unittest.TestCase):
...
...
Misc/NEWS
View file @
dea76376
...
...
@@ -265,6 +265,9 @@ Core and Builtins
Library
-------
-
Issue
#
23815
:
Fixed
crashes
related
to
directly
created
instances
of
types
in
_tkinter
and
curses
.
panel
modules
.
-
Issue
#
17765
:
weakref
.
ref
()
no
longer
silently
ignores
keyword
arguments
.
Patch
by
Georg
Brandl
.
...
...
Modules/_curses_panel.c
View file @
dea76376
...
...
@@ -506,10 +506,11 @@ PyInit__curses_panel(void)
d
=
PyModule_GetDict
(
m
);
/* Initialize object type */
_curses_panelstate
(
m
)
->
PyCursesPanel_Type
=
\
PyType_FromSpec
(
&
PyCursesPanel_Type_spec
);
if
(
_curses_panelstate
(
m
)
->
PyCursesPanel_Type
==
NULL
)
v
=
PyType_FromSpec
(
&
PyCursesPanel_Type_spec
);
if
(
v
==
NULL
)
goto
fail
;
((
PyTypeObject
*
)
v
)
->
tp_new
=
NULL
;
_curses_panelstate
(
m
)
->
PyCursesPanel_Type
=
v
;
import_curses
();
if
(
PyErr_Occurred
())
...
...
Modules/_tkinter.c
View file @
dea76376
...
...
@@ -3544,6 +3544,7 @@ PyInit__tkinter(void)
Py_DECREF
(
m
);
return
NULL
;
}
((
PyTypeObject
*
)
o
)
->
tp_new
=
NULL
;
if
(
PyModule_AddObject
(
m
,
"TkappType"
,
o
))
{
Py_DECREF
(
o
);
Py_DECREF
(
m
);
...
...
@@ -3556,6 +3557,7 @@ PyInit__tkinter(void)
Py_DECREF
(
m
);
return
NULL
;
}
((
PyTypeObject
*
)
o
)
->
tp_new
=
NULL
;
if
(
PyModule_AddObject
(
m
,
"TkttType"
,
o
))
{
Py_DECREF
(
o
);
Py_DECREF
(
m
);
...
...
@@ -3568,6 +3570,7 @@ PyInit__tkinter(void)
Py_DECREF
(
m
);
return
NULL
;
}
((
PyTypeObject
*
)
o
)
->
tp_new
=
NULL
;
if
(
PyModule_AddObject
(
m
,
"Tcl_Obj"
,
o
))
{
Py_DECREF
(
o
);
Py_DECREF
(
m
);
...
...
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