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
2ed94eb5
Kaydet (Commit)
2ed94eb5
authored
Eyl 14, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Do not print additional shutdown message when gc.DEBUG_SAVEALL is set
üst
0055c421
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
test_gc.py
Lib/test/test_gc.py
+9
-4
gcmodule.c
Modules/gcmodule.c
+2
-1
No files found.
Lib/test/test_gc.py
Dosyayı görüntüle @
2ed94eb5
...
@@ -482,8 +482,7 @@ class GCTests(unittest.TestCase):
...
@@ -482,8 +482,7 @@ class GCTests(unittest.TestCase):
x.x = x
x.x = x
x.y = X('second')
x.y = X('second')
del x
del x
if
%
d:
gc.set_debug(
%
s)
gc.set_debug(gc.DEBUG_UNCOLLECTABLE)
"""
"""
def
run_command
(
code
):
def
run_command
(
code
):
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
code
],
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
code
],
...
@@ -494,13 +493,19 @@ class GCTests(unittest.TestCase):
...
@@ -494,13 +493,19 @@ class GCTests(unittest.TestCase):
self
.
assertEqual
(
stdout
.
strip
(),
b
""
)
self
.
assertEqual
(
stdout
.
strip
(),
b
""
)
return
strip_python_stderr
(
stderr
)
return
strip_python_stderr
(
stderr
)
stderr
=
run_command
(
code
%
0
)
stderr
=
run_command
(
code
%
"0"
)
self
.
assertIn
(
b
"gc: 2 uncollectable objects at shutdown"
,
stderr
)
self
.
assertIn
(
b
"gc: 2 uncollectable objects at shutdown"
,
stderr
)
self
.
assertNotIn
(
b
"[<X 'first'>, <X 'second'>]"
,
stderr
)
self
.
assertNotIn
(
b
"[<X 'first'>, <X 'second'>]"
,
stderr
)
# With DEBUG_UNCOLLECTABLE, the garbage list gets printed
# With DEBUG_UNCOLLECTABLE, the garbage list gets printed
stderr
=
run_command
(
code
%
1
)
stderr
=
run_command
(
code
%
"gc.DEBUG_UNCOLLECTABLE"
)
self
.
assertIn
(
b
"gc: 2 uncollectable objects at shutdown"
,
stderr
)
self
.
assertIn
(
b
"gc: 2 uncollectable objects at shutdown"
,
stderr
)
self
.
assertIn
(
b
"[<X 'first'>, <X 'second'>]"
,
stderr
)
self
.
assertIn
(
b
"[<X 'first'>, <X 'second'>]"
,
stderr
)
# With DEBUG_SAVEALL, no additional message should get printed
# (because gc.garbage also contains normally reclaimable cyclic
# references, and its elements get printed at runtime anyway).
stderr
=
run_command
(
code
%
"gc.DEBUG_SAVEALL"
)
self
.
assertNotIn
(
b
"uncollectable objects at shutdown"
,
stderr
)
class
GCTogglingTests
(
unittest
.
TestCase
):
class
GCTogglingTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
Modules/gcmodule.c
Dosyayı görüntüle @
2ed94eb5
...
@@ -1366,7 +1366,8 @@ PyGC_Collect(void)
...
@@ -1366,7 +1366,8 @@ PyGC_Collect(void)
void
void
_PyGC_Fini
(
void
)
_PyGC_Fini
(
void
)
{
{
if
(
garbage
!=
NULL
&&
PyList_GET_SIZE
(
garbage
)
>
0
)
{
if
(
!
(
debug
&
DEBUG_SAVEALL
)
&&
garbage
!=
NULL
&&
PyList_GET_SIZE
(
garbage
)
>
0
)
{
PySys_WriteStderr
(
PySys_WriteStderr
(
"gc: "
"gc: "
"%"
PY_FORMAT_SIZE_T
"d uncollectable objects at shutdown:
\n
"
,
"%"
PY_FORMAT_SIZE_T
"d uncollectable objects at shutdown:
\n
"
,
...
...
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