8000 bpo-35381 Remove all static state from posixmodule by eduardo-elizondo · Pull Request #15892 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-35381 Remove all static state from posixmodule #15892

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

Merged
merged 45 commits into from
Nov 5, 2019
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e09cf81
Make Posixmodule use PyType_FromSpec
eduardo-elizondo Dec 3, 2018
40f0ff4
Added NEWS
eduardo-elizondo Dec 3, 2018
5be18a1
Updated hash
eduardo-elizondo Dec 3, 2018
9479848
Addressed PR Issues
eduardo-elizondo Jan 19, 2019
d31df5f
Rebased
eduardo-elizondo Jan 19, 2019
c84689c
Ran argument clinic
eduardo-elizondo Jan 19, 2019
796a8d7
Added NEWS
eduardo-elizondo Jan 19, 2019
b7cae5b
Remove INCREF from GenericAlloc
eduardo-elizondo Jan 19, 2019
5fa6e46
Make Posixmodule use PyType_FromSpec
eduardo-elizondo Dec 3, 2018
df178b4
Added NEWS
eduardo-elizondo Dec 3, 2018
e59208f
Updated hash
eduardo-elizondo Dec 3, 2018
def6467
Addressed PR Issues
eduardo-elizondo Jan 19, 2019
bb2ead8
Ran argument clinic
eduardo-elizondo Jan 19, 2019
427c772
Added NEWS
eduardo-elizondo Jan 19, 2019
7b9b85f
Merged to master
eduardo-elizondo Sep 11, 2019
9e8fb83
Merge branch 'master' into posixmodule-fromspec
eduardo-elizondo Sep 11, 2019
99d5c26
Cleaned up slot acces
eduardo-elizondo Sep 11, 2019
ca19f51
Cleaned up more slot accesses
eduardo-elizondo Sep 11, 2019
8af0c4e
Nits
eduardo-elizondo Sep 11, 2019
cee2cd9
Fixes
eduardo-elizondo Sep 11, 2019
a8d2f56
Run clinic
eduardo-elizondo Sep 11, 2019
5e4d2ab
Run clinic
eduardo-elizondo Sep 11, 2019
c42ec45
Improve error handling
encukou Sep 11, 2019
d27a547
Remove static from posixmodule.c
eduardo-elizondo Sep 12, 2019
6af98a9
Merge branch 'posixmodule-fromspec' of https://github.com/eduardo-eli…
eduardo-elizondo Sep 12, 2019
a723d1c
Address Comments
eduardo-elizondo Sep 12, 2019
e91096a
Address Comments
eduardo-elizondo Sep 12, 2019
3cf259e
Fix Windows build
eduardo-elizondo Sep 12, 2019
925a41e
Use interned strings for constants in module state
encukou Sep 13, 2019
ad7359b
Use descriptor directly, rather than look it up by name
encukou Sep 13, 2019
5de545d
Bring _Py_IDENTIFIER(__fspath__) back
encukou Sep 13, 2019
3ada298
Use the tp_free slot directly
encukou Sep 13, 2019
4c80b06
Remove duplicate function
encukou Sep 13, 2019
6e505ac
Use tp_new directly
encukou Sep 13, 2019
b9a49aa
Don't call PyState_AddModule
encukou Sep 13, 2019
c1a6d03
Add __new__ changes
eduardo-elizondo Sep 17, 2019
bbe887f
Merge branch 'master' into posixmodule-fromspec
eduardo-elizondo Sep 17, 2019
4a6d4ec
Regenerate clinic
eduardo-elizondo Sep 18, 2019
138ffb6
Nits
eduardo-elizondo Sep 23, 2019
78fbed3
Merge to master
eduardo-elizondo Nov 3, 2019
1b57f3a
Revert tp_new changes
eduardo-elizondo Nov 3, 2019
e7e9634
Rerun argument clinit
eduardo-elizondo Nov 3, 2019
3bf99bf
More fixes
eduardo-elizondo Nov 3, 2019
afb249c
Re-add newlines and fix docstring for os.sched_param.__new__
encukou Nov 5, 2019
187b5d4
Code style nitpicks
encukou Nov 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address Comments
  • Loading branch information
eduardo-elizondo committed Sep 12, 2019
commit a723d1cc4b33a445acc2b872b59ecbed496b4949
17 changes: 14 additions & 3 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2104,7 +2104,14 @@ statresult_new(PyTypeObject *type, PyObject *args)

/* Remove the cls object from the argument list */
sequence = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
if (!sequence) {
return NULL;
}
kwds = PyDict_New();
if (!kwds) {
Py_DECREF(sequence);
return NULL;
}
result = (PyStructSequence*)_posixstate_global->structseq_new(type, sequence, kwds);
Py_DECREF(sequence);
Py_DECREF(kwds);
Expand Down Expand Up @@ -4595,7 +4602,7 @@ or via the attributes sysname, nodename, release, version, and machine.\n\
See os.uname for more information.");

static PyStructSequence_Desc uname_result_desc = {
"uname_result", /* name */
MODNAME ".uname_result", /* name */
uname_result__doc__, /* doc */
uname_result_fields,
5
Expand Down Expand Up @@ -6260,7 +6267,6 @@ PyDoc_STRVAR(os_sched_param__doc__,
"sched_param(sched_priority)\n"
"--\n"
"\n"
"Current has only one field: sched_priority\");\n"
"\n"
" sched_priority\n"
" A scheduling parameter.");
Expand All @@ -6274,15 +6280,19 @@ os_sched_param(PyTypeObject *type, PyObject *args, PyObject *kwargs)

/* Remove the cls object from the argument list */
sequence = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
if (!sequence) {
return NULL;
}
int result = PyArg_ParseTupleAndKeywords(sequence, kwargs, _format, _keywords,
&sched_priority);
Py_DECREF(sequence);
if (!result) {
return NULL;
}
res = PyStructSequence_New((PyTypeObject *)type);
if (!res)
if (!res) {
return NULL;
}
Py_INCREF(sched_priority);
PyStructSequence_SET_ITEM(res, 0, sched_priority);
return res;
Expand Down Expand Up @@ -12819,6 +12829,7 @@ static PyType_Spec DirEntryType_spec = {
DirEntryType_slots
};


#ifdef MS_WINDOWS

static wchar_t *
Expand Down
0