Skip to content
This repository was archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Latest upstream 3.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
carlwgeorge committed Dec 5, 2018
1 parent a022bd4 commit e5cf15d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
47 changes: 24 additions & 23 deletions SOURCES/00170-gc-assertions.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/Include/object.h b/Include/object.h
index 0c88603..e3413e8 100644
index 63e37b8..613b26c 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -1059,6 +1059,49 @@ PyAPI_FUNC(void)
@@ -1071,6 +1071,49 @@ PyAPI_FUNC(void)
_PyObject_DebugTypeStats(FILE *out);
#endif /* ifndef Py_LIMITED_API */

Expand Down Expand Up @@ -53,23 +53,24 @@ index 0c88603..e3413e8 100644
}
#endif
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index e727499..6efcafb 100644
index 7e82b24..4497b8f 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -1,10 +1,11 @@
@@ -1,10 +1,12 @@
import unittest
from test.support import (verbose, refcount_test, run_unittest,
strip_python_stderr, cpython_only, start_threads,
- temp_dir, requires_type_collecting)
+ temp_dir, import_module, requires_type_collecting)
- temp_dir, requires_type_collecting, TESTFN, unlink)
+ temp_dir, requires_type_collecting, TESTFN, unlink,
+ import_module)
from test.support.script_helper import assert_python_ok, make_script

import sys
+import sysconfig
import time
import gc
import weakref
@@ -50,6 +51,8 @@ class GC_Detector(object):
@@ -50,6 +52,8 @@ class GC_Detector(object):
# gc collects it.
self.wr = weakref.ref(C1055820(666), it_happened)

Expand All @@ -78,7 +79,7 @@ index e727499..6efcafb 100644
@with_tp_del
class Uncollectable(object):
"""Create a reference cycle with multiple __del__ methods.
@@ -862,6 +865,50 @@ class GCCallbackTests(unittest.TestCase):
@@ -877,6 +881,50 @@ class GCCallbackTests(unittest.TestCase):
self.assertEqual(len(gc.garbage), 0)


Expand Down Expand Up @@ -130,10 +131,10 @@ index e727499..6efcafb 100644
def setUp(self):
gc.enable()
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 0c6f444..87edd5a 100644
index 3bddc40..0cc24f7 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -341,7 +341,8 @@ update_refs(PyGC_Head *containers)
@@ -342,7 +342,8 @@ update_refs(PyGC_Head *containers)
{
PyGC_Head *gc = containers->gc.gc_next;
for (; gc != containers; gc = gc->gc.gc_next) {
Expand All @@ -143,7 +144,7 @@ index 0c6f444..87edd5a 100644
_PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc)));
/* Python's cyclic gc should never see an incoming refcount
* of 0: if something decref'ed to 0, it should have been
@@ -361,7 +362,8 @@ update_refs(PyGC_Head *containers)
@@ -362,7 +363,8 @@ update_refs(PyGC_Head *containers)
* so serious that maybe this should be a release-build
* check instead of an assert?
*/
Expand All @@ -153,7 +154,7 @@ index 0c6f444..87edd5a 100644
}
}

@@ -376,7 +378,9 @@ visit_decref(PyObject *op, void *data)
@@ -377,7 +379,9 @@ visit_decref(PyObject *op, void *data)
* generation being collected, which can be recognized
* because only they have positive gc_refs.
*/
Expand All @@ -164,7 +165,7 @@ index 0c6f444..87edd5a 100644
if (_PyGCHead_REFS(gc) > 0)
_PyGCHead_DECREF(gc);
}
@@ -436,9 +440,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable)
@@ -437,9 +441,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable)
* If gc_refs == GC_UNTRACKED, it must be ignored.
*/
else {
Expand All @@ -178,7 +179,7 @@ index 0c6f444..87edd5a 100644
}
}
return 0;
@@ -480,7 +485,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable)
@@ -481,7 +486,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable)
*/
PyObject *op = FROM_GC(gc);
traverseproc traverse = Py_TYPE(op)->tp_traverse;
Expand All @@ -187,7 +188,7 @@ index 0c6f444..87edd5a 100644
_PyGCHead_SET_REFS(gc, GC_REACHABLE);
(void) traverse(op,
(visitproc)visit_reachable,
@@ -543,7 +548,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers)
@@ -544,7 +549,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers)
for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) {
PyObject *op = FROM_GC(gc);

Expand All @@ -196,7 +197,7 @@ index 0c6f444..87edd5a 100644
next = gc->gc.gc_next;

if (has_legacy_finalizer(op)) {
@@ -619,7 +624,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
@@ -620,7 +625,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
PyWeakReference **wrlist;

op = FROM_GC(gc);
Expand All @@ -205,7 +206,7 @@ index 0c6f444..87edd5a 100644
next = gc->gc.gc_next;

if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op)))
@@ -640,9 +645,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
@@ -641,9 +646,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
* the callback pointer intact. Obscure: it also
* changes *wrlist.
*/
Expand All @@ -217,7 +218,7 @@ index 0c6f444..87edd5a 100644
if (wr->wr_callback == NULL)
continue; /* no callback */

@@ -676,7 +681,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
@@ -677,7 +682,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
*/
if (IS_TENTATIVELY_UNREACHABLE(wr))
continue;
Expand All @@ -226,7 +227,7 @@ index 0c6f444..87edd5a 100644

/* Create a new reference so that wr can't go away
* before we can process it again.
@@ -685,7 +690,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
@@ -686,7 +691,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)

/* Move wr to wrcb_to_call, for the next pass. */
wrasgc = AS_GC(wr);
Expand All @@ -236,7 +237,7 @@ index 0c6f444..87edd5a 100644
next isn't, so they can't
be the same */
gc_list_move(wrasgc, &wrcb_to_call);
@@ -701,11 +707,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
@@ -702,11 +708,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)

gc = wrcb_to_call.gc.gc_next;
op = FROM_GC(gc);
Expand All @@ -251,7 +252,7 @@ index 0c6f444..87edd5a 100644

/* copy-paste of weakrefobject.c's handle_callback() */
temp = PyObject_CallFunctionObjArgs(callback, wr, NULL);
@@ -822,12 +828,14 @@ check_garbage(PyGC_Head *collectable)
@@ -820,12 +826,14 @@ check_garbage(PyGC_Head *collectable)
for (gc = collectable->gc.gc_next; gc != collectable;
gc = gc->gc.gc_next) {
_PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc)));
Expand All @@ -269,10 +270,10 @@ index 0c6f444..87edd5a 100644
return -1;
}
diff --git a/Objects/object.c b/Objects/object.c
index 559794f..a47d47f 100644
index defff55..a50697d 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -2022,6 +2022,35 @@ _PyTrash_thread_destroy_chain(void)
@@ -2030,6 +2030,35 @@ _PyTrash_thread_destroy_chain(void)
}
}

Expand Down
5 changes: 4 additions & 1 deletion SPECS/python36u.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ URL: https://www.python.org/
# pybasever without the dot:
%global pyshortver 36

Version: %{pybasever}.5
Version: %{pybasever}.7
Release: 1.ius%{?dist}
License: Python

Expand Down Expand Up @@ -1286,6 +1286,9 @@ CheckPython optimized
# ======================================================

%changelog
* Wed Dec 05 2018 Carl George <carl@george.computer> - 3.6.7-1.ius
- Latest upstream

* Mon Apr 09 2018 Carl George <carl@george.computer> - 3.6.5-1.ius
- Latest upstream
- Fix deprecation warning on using imp in check-pyc-and-pyo-timestamps.py (Fedora)
Expand Down

0 comments on commit e5cf15d

Please sign in to comment.