summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/import.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 46a1acc6..67c6cb2 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -881,7 +881,9 @@ write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
{
FILE *fp;
time_t mtime = srcstat->st_mtime;
-#ifndef MS_WINDOWS
+#ifdef MS_WINDOWS /* since Windows uses different permissions */
+ mode_t mode = srcstat->st_mode & ~S_IEXEC;
+#else
mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
#endif