/
patch-issue28501
49 lines (40 loc) · 1.1 KB
/
patch-issue28501
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- Modules/clinic/posixmodule.c.h
+++ Modules/clinic/posixmodule.c.h
@@ -1412,6 +1412,8 @@
#endif /* defined(HAVE_SYSTEM) && !defined(MS_WINDOWS) */
+#if (defined(MS_WINDOWS) || defined(HAVE_UMASK))
+
PyDoc_STRVAR(os_umask__doc__,
"umask($module, mask, /)\n"
"--\n"
@@ -1439,6 +1441,8 @@
return return_value;
}
+#endif /* (defined(MS_WINDOWS) || defined(HAVE_UMASK)) */
+
PyDoc_STRVAR(os_unlink__doc__,
"unlink($module, /, path, *, dir_fd=None)\n"
"--\n"
@@ -5758,6 +5762,10 @@
#define OS_SYSTEM_METHODDEF
#endif /* !defined(OS_SYSTEM_METHODDEF) */
+#ifndef OS_UMASK_METHODDEF
+ #define OS_UMASK_METHODDEF
+#endif /* !defined(OS_UMASK_METHODDEF) */
+
#ifndef OS_UNAME_METHODDEF
#define OS_UNAME_METHODDEF
#endif /* !defined(OS_UNAME_METHODDEF) */
--- Modules/posixmodule.c
+++ Modules/posixmodule.c
@@ -4140,6 +4140,7 @@
#endif /* HAVE_SYSTEM */
+#if defined(MS_WINDOWS) || defined(HAVE_UMASK)
/*[clinic input]
os.umask
@@ -4158,6 +4159,7 @@
return posix_error();
return PyLong_FromLong((long)i);
}
+#endif /* MS_WINDOWS || HAVE_UMASK */
#ifdef MS_WINDOWS