From 651fc30af7ac6138764106b87632cabca56a98bb Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 16 Mar 2021 08:03:37 +0200 Subject: bpo-43499: Silence compiler warnings about using legacy C API on Windows (GH-24873) --- Python/fileutils.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Python/fileutils.c') diff --git a/Python/fileutils.c b/Python/fileutils.c index ddc090988f..cf11e9297d 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1010,7 +1010,10 @@ _Py_stat(PyObject *path, struct stat *statbuf) struct _stat wstatbuf; const wchar_t *wpath; +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wpath = _PyUnicode_AsUnicode(path); +_Py_COMP_DIAG_POP if (wpath == NULL) return -2; @@ -1455,7 +1458,10 @@ _Py_fopen_obj(PyObject *path, const char *mode) Py_TYPE(path)); return NULL; } +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wpath = _PyUnicode_AsUnicode(path); +_Py_COMP_DIAG_POP if (wpath == NULL) return NULL; -- cgit v1.2.1