File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,13 +15,11 @@ mod _asyncio;
1515pub mod array;
1616mod binascii;
1717mod bisect;
18+ mod bz2;
1819mod cmath;
20+ mod compression; // internal module
1921mod contextvars;
2022mod csv;
21- mod gc;
22-
23- mod bz2;
24- mod compression; // internal module
2523#[ cfg( not( any( target_os = "android" , target_arch = "wasm32" ) ) ) ]
2624mod lzma;
2725mod zlib;
@@ -126,7 +124,6 @@ pub fn stdlib_module_defs(ctx: &Context) -> Vec<&'static builtins::PyModuleDef>
126124 faulthandler:: module_def( ctx) ,
127125 #[ cfg( any( unix, target_os = "wasi" ) ) ]
128126 fcntl:: module_def( ctx) ,
129- gc:: module_def( ctx) ,
130127 #[ cfg( all( unix, not( any( target_os = "android" , target_os = "redox" ) ) ) ) ]
131128 grp:: module_def( ctx) ,
132129 hashlib:: module_def( ctx) ,
Original file line number Diff line number Diff line change @@ -933,7 +933,7 @@ impl PyObject {
933933 /// Check if the object has been finalized (__del__ already called).
934934 /// _PyGC_FINALIZED in Py_GIL_DISABLED mode.
935935 #[ inline]
936- pub fn gc_finalized ( & self ) -> bool {
936+ pub ( crate ) fn gc_finalized ( & self ) -> bool {
937937 GcBits :: from_bits_retain ( self . 0 . gc_bits . load ( Ordering :: Relaxed ) ) . contains ( GcBits :: FINALIZED )
938938 }
939939
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ pub(crate) use gc::module_def;
22
33#[ pymodule]
44mod gc {
5- use crate :: vm :: {
5+ use crate :: {
66 PyObjectRef , PyResult , VirtualMachine ,
77 builtins:: PyListRef ,
88 function:: { FuncArgs , OptionalArg } ,
@@ -205,7 +205,6 @@ mod gc {
205205 /// Return True if the object has been finalized by the garbage collector.
206206 #[ pyfunction]
207207 fn is_finalized ( obj : PyObjectRef ) -> bool {
208- // Check the per-object finalized flag directly
209208 obj. gc_finalized ( )
210209 }
211210
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ mod codecs;
77mod collections;
88pub mod errno;
99mod functools;
10+ mod gc;
1011mod imp;
1112pub mod io;
1213mod itertools;
@@ -84,6 +85,7 @@ pub fn builtin_module_defs(ctx: &Context) -> Vec<&'static PyModuleDef> {
8485 ctypes:: module_def( ctx) ,
8586 errno:: module_def( ctx) ,
8687 functools:: module_def( ctx) ,
88+ gc:: module_def( ctx) ,
8789 imp:: module_def( ctx) ,
8890 io:: module_def( ctx) ,
8991 itertools:: module_def( ctx) ,
You can’t perform that action at this time.
0 commit comments