[Python-checkins] bpo-40653: Move _dirnameW out of GH-ifdef HAVE_SYMLINK/GH-endif (GH-20144)

Miss Islington (bot) webhook-mailer at python.org
Mon May 18 12:36:10 EDT 2020


https://github.com/python/cpython/commit/ddd5bbdeec8cf18ef074b3506c96d22ac3dc1f93
commit: ddd5bbdeec8cf18ef074b3506c96d22ac3dc1f93
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-05-18T09:36:02-07:00
summary:

bpo-40653: Move _dirnameW out of GH-ifdef HAVE_SYMLINK/GH-endif (GH-20144)

(cherry picked from commit 7f21c9ac872acc2114aee3313d132b016550ff42)

Co-authored-by: Minmin Gong <gongminmin at msn.com>

files:
A Misc/NEWS.d/next/Build/2020-05-17-03-33-00.bpo-40653.WI8UGn.rst
M Modules/posixmodule.c

diff --git a/Misc/NEWS.d/next/Build/2020-05-17-03-33-00.bpo-40653.WI8UGn.rst b/Misc/NEWS.d/next/Build/2020-05-17-03-33-00.bpo-40653.WI8UGn.rst
new file mode 100644
index 0000000000000..1e6c5cb32b722
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2020-05-17-03-33-00.bpo-40653.WI8UGn.rst
@@ -0,0 +1 @@
+Move _dirnameW out of HAVE_SYMLINK to fix a potential compiling issue.
\ No newline at end of file
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index eb0b56aebbaa3..726e3723f99d3 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -8019,8 +8019,6 @@ os_readlink_impl(PyObject *module, path_t *path, int dir_fd)
 }
 #endif /* defined(HAVE_READLINK) || defined(MS_WINDOWS) */
 
-#ifdef HAVE_SYMLINK
-
 #if defined(MS_WINDOWS)
 
 /* Remove the last portion of the path - return 0 on success */
@@ -8043,6 +8041,12 @@ _dirnameW(WCHAR *path)
     return 0;
 }
 
+#endif
+
+#ifdef HAVE_SYMLINK
+
+#if defined(MS_WINDOWS)
+
 /* Is this path absolute? */
 static int
 _is_absW(const WCHAR *path)



More information about the Python-checkins mailing list