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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -605,6 +605,7 @@
fullname = path.join(dir, file)
try:
exec_func(fullname, *argrest)
+ return
except (FileNotFoundError, NotADirectoryError) as e:
last_exc = e
except OSError as e:
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -607,7 +607,7 @@
default in case the command should fail.
"""
- if sys.platform in ('dos', 'win32', 'win16'):
+ if sys.platform in ('dos', 'win32', 'win16', 'darwin'):
# XXX Others too ?
return default
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -75,7 +75,7 @@
_mswindows = True
# wasm32-emscripten and wasm32-wasi do not support processes
-_can_fork_exec = sys.platform not in {"emscripten", "wasi"}
+_can_fork_exec = sys.platform not in {"emscripten", "wasi", "darwin"}
if _mswindows:
import _winapi
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -2624,11 +2624,9 @@
if sys.platform == 'darwin':
- from _scproxy import _get_proxy_settings, _get_proxies
def proxy_bypass_macosx_sysconf(host):
- proxy_settings = _get_proxy_settings()
- return _proxy_bypass_macosx_sysconf(host, proxy_settings)
+ return False
def getproxies_macosx_sysconf():
"""Return a dictionary of scheme -> proxy server URL mappings.
@@ -2636,7 +2636,7 @@
This function uses the MacOSX framework SystemConfiguration
to fetch the proxy information.
"""
- return _get_proxies()
+ return {}
@@ -2649,9 +2649,9 @@
"""
proxies = getproxies_environment()
if proxies:
- return proxy_bypass_environment(host, proxies)
+ return False
else:
- return proxy_bypass_macosx_sysconf(host)
+ return False
def getproxies():
return getproxies_environment() or getproxies_macosx_sysconf()
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -71,6 +71,10 @@
#define MAX_GROUPS 64
#endif
+#if defined(__APPLE__)
+#include <TargetConditionals.h>
+#endif
+
#define POSIX_CALL(call) do { if ((call) == -1) goto error; } while (0)
static struct PyModuleDef _posixsubprocessmodule;
@@ -661,14 +665,25 @@
for (i = 0; exec_array[i] != NULL; ++i) {
const char *executable = exec_array[i];
if (envp) {
- execve(executable, argv, envp);
+#if defined(TARGET_OS_TV)
+ saved_errno = ENOTSUP;
+#elif defined(TARGET_OS_IOS)
+ saved_errno = execve(executable, argv, envp);
+#endif
+ break;
} else {
- execv(executable, argv);
+#if defined(TARGET_OS_TV)
+ saved_errno = ENOTSUP;
+#elif defined(TARGET_OS_IOS)
+ saved_errno = execv(executable, argv);
+#endif
+ break;
}
if (errno != ENOENT && errno != ENOTDIR && saved_errno == 0) {
saved_errno = errno;
}
}
+ if (saved_errno == 0) return;
/* Report the first exec error, not the last. */
if (saved_errno)
errno = saved_errno;
@@ -751,7 +766,12 @@
} else
#endif
{
+#if defined(TARGET_OS_TV)
+ pid = -1;
+ errno = ENOTSUP;
+#else
pid = fork();
+#endif
}
if (pid != 0) {
@@ -763,6 +783,7 @@
* the code below.
*/
+#if !defined(TARGET_OS_TV)
if (preexec_fn != Py_None) {
/* We'll be calling back into Python later so we need to do this.
* This call may not be async-signal-safe but neither is calling
@@ -779,6 +800,7 @@
call_setuid, uid, child_umask, child_sigmask,
py_fds_to_keep, preexec_fn, preexec_fn_args_tuple);
_exit(255);
+#endif
return 0; /* Dead code to avoid a potential compiler warning. */
}
@@ -990,8 +1012,10 @@
preexec_fn_args_tuple = PyTuple_New(0);
if (!preexec_fn_args_tuple)
goto cleanup;
+#if !defined(TARGET_OS_TV)
PyOS_BeforeFork();
need_after_fork = 1;
+#endif
}
/* NOTE: When old_sigmask is non-NULL, do_fork_exec() may use vfork(). */
@@ -1051,8 +1073,10 @@
}
#endif
+#if !defined(TARGET_OS_TV)
if (need_after_fork)
PyOS_AfterFork_Parent();
+#endif
cleanup:
if (saved_errno != 0) {
|