-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
bpo-46920: Remove code made dead long ago with #if 0 #31681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
a0693cf
b4f6f13
f9b4ef0
e6c3092
9927513
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1825,25 +1825,6 @@ Py_FinalizeEx(void) | |
status = -1; | ||
} | ||
|
||
/* Collect final garbage. This disposes of cycles created by | ||
* class definitions, for example. | ||
* XXX This is disabled because it caused too many problems. If | ||
* XXX a __del__ or weakref callback triggers here, Python code has | ||
* XXX a hard time running, because even the sys module has been | ||
* XXX cleared out (sys.stdout is gone, sys.excepthook is gone, etc). | ||
* XXX One symptom is a sequence of information-free messages | ||
* XXX coming from threads (if a __del__ or callback is invoked, | ||
* XXX other threads can execute too, and any exception they encounter | ||
* XXX triggers a comedy of errors as subsystem after subsystem | ||
* XXX fails to find what it *expects* to find in sys to help report | ||
* XXX the exception and consequent unexpected failures). I've also | ||
* XXX seen segfaults then, after adding print statements to the | ||
* XXX Python code getting called. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is oudated and must be removed. |
||
#if 0 | ||
_PyGC_CollectIfEnabled(); | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I spent significant time to rework how the GC is called. The last call is now in interpreter_clear() of pystate.c. |
||
|
||
/* Disable tracemalloc after all Python objects have been destroyed, | ||
so it is possible to use tracemalloc in objects destructor. */ | ||
_PyTraceMalloc_Fini(); | ||
|
@@ -2424,7 +2405,6 @@ init_sys_streams(PyThreadState *tstate) | |
_PySys_SetAttr(&_Py_ID(stdout), std); | ||
Py_DECREF(std); | ||
|
||
#if 1 /* Disable this if you have trouble debugging bootstrap stuff */ | ||
/* Set sys.stderr, replaces the preliminary stderr */ | ||
fd = fileno(stderr); | ||
std = create_stdio(config, iomod, fd, 1, "<stderr>", | ||
|
@@ -2455,7 +2435,6 @@ init_sys_streams(PyThreadState *tstate) | |
goto error; | ||
} | ||
Py_DECREF(std); | ||
#endif | ||
|
||
goto done; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These have been useful occasionally, so I would rather not remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored.