aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/initconfig.c12
-rw-r--r--Python/preconfig.c12
2 files changed, 24 insertions, 0 deletions
diff --git a/Python/initconfig.c b/Python/initconfig.c
index e5b87878918..62f1f67473d 100644
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -201,6 +201,8 @@ int Py_LegacyWindowsStdioFlag = 0; /* Uses FileIO instead of WindowsConsoleIO */
static PyObject *
_Py_GetGlobalVariablesAsDict(void)
{
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
PyObject *dict, *obj;
dict = PyDict_New();
@@ -267,15 +269,19 @@ fail:
#undef SET_ITEM
#undef SET_ITEM_INT
#undef SET_ITEM_STR
+_Py_COMP_DIAG_POP
}
char*
Py_GETENV(const char *name)
{
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
if (Py_IgnoreEnvironmentFlag) {
return NULL;
}
return getenv(name);
+_Py_COMP_DIAG_POP
}
/* --- PyStatus ----------------------------------------------- */
@@ -1443,6 +1449,8 @@ config_get_env_dup(PyConfig *config,
static void
config_get_global_vars(PyConfig *config)
{
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
if (config->_config_init != _PyConfig_INIT_COMPAT) {
/* Python and Isolated configuration ignore global variables */
return;
@@ -1478,6 +1486,7 @@ config_get_global_vars(PyConfig *config)
#undef COPY_FLAG
#undef COPY_NOT_FLAG
+_Py_COMP_DIAG_POP
}
@@ -1485,6 +1494,8 @@ config_get_global_vars(PyConfig *config)
static void
config_set_global_vars(const PyConfig *config)
{
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
#define COPY_FLAG(ATTR, VAR) \
if (config->ATTR != -1) { \
VAR = config->ATTR; \
@@ -1519,6 +1530,7 @@ config_set_global_vars(const PyConfig *config)
#undef COPY_FLAG
#undef COPY_NOT_FLAG
+_Py_COMP_DIAG_POP
}
diff --git a/Python/preconfig.c b/Python/preconfig.c
index c30c75807a2..77a86d651eb 100644
--- a/Python/preconfig.c
+++ b/Python/preconfig.c
@@ -24,6 +24,8 @@ int _Py_HasFileSystemDefaultEncodeErrors = 0;
void
_Py_ClearFileSystemEncoding(void)
{
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
if (!Py_HasFileSystemDefaultEncoding && Py_FileSystemDefaultEncoding) {
PyMem_RawFree((char*)Py_FileSystemDefaultEncoding);
Py_FileSystemDefaultEncoding = NULL;
@@ -32,6 +34,7 @@ _Py_ClearFileSystemEncoding(void)
PyMem_RawFree((char*)Py_FileSystemDefaultEncodeErrors);
Py_FileSystemDefaultEncodeErrors = NULL;
}
+_Py_COMP_DIAG_POP
}
@@ -56,11 +59,14 @@ _Py_SetFileSystemEncoding(const char *encoding, const char *errors)
_Py_ClearFileSystemEncoding();
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
Py_FileSystemDefaultEncoding = encoding2;
Py_HasFileSystemDefaultEncoding = 0;
Py_FileSystemDefaultEncodeErrors = errors2;
_Py_HasFileSystemDefaultEncodeErrors = 0;
+_Py_COMP_DIAG_POP
return 0;
}
@@ -472,6 +478,8 @@ preconfig_get_global_vars(PyPreConfig *config)
config->ATTR = !(VALUE); \
}
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
COPY_FLAG(isolated, Py_IsolatedFlag);
COPY_NOT_FLAG(use_environment, Py_IgnoreEnvironmentFlag);
if (Py_UTF8Mode > 0) {
@@ -480,6 +488,7 @@ preconfig_get_global_vars(PyPreConfig *config)
#ifdef MS_WINDOWS
COPY_FLAG(legacy_windows_fs_encoding, Py_LegacyWindowsFSEncodingFlag);
#endif
+_Py_COMP_DIAG_POP
#undef COPY_FLAG
#undef COPY_NOT_FLAG
@@ -498,12 +507,15 @@ preconfig_set_global_vars(const PyPreConfig *config)
VAR = !config->ATTR; \
}
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
COPY_FLAG(isolated, Py_IsolatedFlag);
COPY_NOT_FLAG(use_environment, Py_IgnoreEnvironmentFlag);
#ifdef MS_WINDOWS
COPY_FLAG(legacy_windows_fs_encoding, Py_LegacyWindowsFSEncodingFlag);
#endif
COPY_FLAG(utf8_mode, Py_UTF8Mode);
+_Py_COMP_DIAG_POP
#undef COPY_FLAG
#undef COPY_NOT_FLAG