mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-32101: Add PYTHONDEVMODE environment variable (#4624)
* bpo-32101: Add sys.flags.dev_mode flag Rename also the "Developer mode" to the "Development mode". * bpo-32101: Add PYTHONDEVMODE environment variable Mention it in the development chapiter.
This commit is contained in:
parent
706e10b186
commit
5e3806f8cf
10 changed files with 78 additions and 16 deletions
|
@ -1814,6 +1814,7 @@ static PyStructSequence_Field flags_fields[] = {
|
|||
{"quiet", "-q"},
|
||||
{"hash_randomization", "-R"},
|
||||
{"isolated", "-I"},
|
||||
{"dev_mode", "-X dev"},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
@ -1821,7 +1822,7 @@ static PyStructSequence_Desc flags_desc = {
|
|||
"sys.flags", /* name */
|
||||
flags__doc__, /* doc */
|
||||
flags_fields, /* fields */
|
||||
13
|
||||
14
|
||||
};
|
||||
|
||||
static PyObject*
|
||||
|
@ -1829,6 +1830,7 @@ make_flags(void)
|
|||
{
|
||||
int pos = 0;
|
||||
PyObject *seq;
|
||||
_PyCoreConfig *core_config = &_PyGILState_GetInterpreterStateUnsafe()->core_config;
|
||||
|
||||
seq = PyStructSequence_New(&FlagsType);
|
||||
if (seq == NULL)
|
||||
|
@ -1853,6 +1855,7 @@ make_flags(void)
|
|||
SetFlag(Py_HashRandomizationFlag);
|
||||
SetFlag(Py_IsolatedFlag);
|
||||
#undef SetFlag
|
||||
PyStructSequence_SET_ITEM(seq, pos++, PyBool_FromLong(core_config->dev_mode));
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
Py_DECREF(seq);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue