Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6ce8d17d
Kaydet (Commit)
6ce8d17d
authored
Haz 22, 2013
tarafından
Andrew Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge from 3.3
üst
70833a8b
9290dd14
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
test_curses.py
Lib/test/test_curses.py
+9
-0
_curses_panel.c
Modules/_curses_panel.c
+8
-3
No files found.
Lib/test/test_curses.py
Dosyayı görüntüle @
6ce8d17d
...
...
@@ -264,6 +264,14 @@ def test_userptr_memory_leak(stdscr):
if
sys
.
getrefcount
(
obj
)
!=
nrefs
:
raise
RuntimeError
(
"set_userptr leaked references"
)
def
test_userptr_segfault
(
stdscr
):
panel
=
curses
.
panel
.
new_panel
(
stdscr
)
class
A
:
def
__del__
(
self
):
panel
.
set_userptr
(
None
)
panel
.
set_userptr
(
A
())
panel
.
set_userptr
(
None
)
def
test_resize_term
(
stdscr
):
if
hasattr
(
curses
,
'resizeterm'
):
lines
,
cols
=
curses
.
LINES
,
curses
.
COLS
...
...
@@ -330,6 +338,7 @@ def main(stdscr):
window_funcs
(
stdscr
)
test_userptr_without_set
(
stdscr
)
test_userptr_memory_leak
(
stdscr
)
test_userptr_segfault
(
stdscr
)
test_resize_term
(
stdscr
)
test_issue6243
(
stdscr
)
test_unget_wch
(
stdscr
)
...
...
Modules/_curses_panel.c
Dosyayı görüntüle @
6ce8d17d
...
...
@@ -323,12 +323,17 @@ static PyObject *
PyCursesPanel_set_panel_userptr
(
PyCursesPanelObject
*
self
,
PyObject
*
obj
)
{
PyObject
*
oldobj
;
int
rc
;
PyCursesInitialised
;
Py_INCREF
(
obj
);
oldobj
=
(
PyObject
*
)
panel_userptr
(
self
->
pan
);
rc
=
set_panel_userptr
(
self
->
pan
,
(
void
*
)
obj
);
if
(
rc
==
ERR
)
{
/* In case of an ncurses error, decref the new object again */
Py_DECREF
(
obj
);
}
Py_XDECREF
(
oldobj
);
Py_INCREF
(
obj
);
return
PyCursesCheckERR
(
set_panel_userptr
(
self
->
pan
,
(
void
*
)
obj
),
"set_panel_userptr"
);
return
PyCursesCheckERR
(
rc
,
"set_panel_userptr"
);
}
static
PyObject
*
...
...
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