Skip to content

Commit fe19e3e

Browse files
committed
Do not reference `environ' on tvOS and watchOS (prohibited).
1 parent 80ea79f commit fe19e3e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

patch/Python/Python-tvos.patch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@
3131
/*
3232
--- a/Modules/posixmodule.c 2015-10-16 03:34:01.000000000 +0600
3333
+++ b/Modules/posixmodule.c 2015-10-16 03:35:46.000000000 +0600
34+
@@ -1197,7 +1197,9 @@
35+
#include <crt_externs.h>
36+
static char **environ;
37+
#elif !defined(_MSC_VER) && ( !defined(__WATCOMC__) || defined(__QNX__) )
38+
+#if !defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && !defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__)
39+
extern char **environ;
40+
+#endif
41+
#endif /* !_MSC_VER */
42+
43+
static PyObject *
44+
@@ -1248,7 +1250,7 @@
45+
Py_DECREF(k);
46+
Py_DECREF(v);
47+
}
48+
-#else
49+
+#elif !defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && !defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__)
50+
if (environ == NULL)
51+
return d;
52+
/* This part ignores errors */
3453
@@ -4463,7 +4463,12 @@
3554

3655
command = PyBytes_AsString(command_obj);

0 commit comments

Comments
 (0)