Skip to content

Commit bf1ed73

Browse files
committed
Fixed #85 -- Corrected another problem with the 3.7 patch.
1 parent abd04b9 commit bf1ed73

File tree

2 files changed

+63
-8
lines changed

2 files changed

+63
-8
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ CFLAGS-macOS=-mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
5252
TARGETS-iOS=iphonesimulator.x86_64 iphoneos.arm64
5353
CFLAGS-iOS=-mios-version-min=8.0
5454
CFLAGS-iphoneos.arm64=-fembed-bitcode
55+
CFLAGS-iphonesimulator.x86_64=-fembed-bitcode
5556

5657
# tvOS targets
5758
TARGETS-tvOS=appletvsimulator.x86_64 appletvos.arm64

patch/Python/Python.patch

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32069,7 +32069,7 @@ index 8eedca8a30..ad70499c82 100644
3206932069
PyFPE_START_PROTECT("in math_hypot", return 0);
3207032070
r = hypot(x, y);
3207132071
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
32072-
index 58cb9b0d46..4a2ae3f024 100644
32072+
index 58cb9b0d46..d01aba8d6f 100644
3207332073
--- a/Modules/posixmodule.c
3207432074
+++ b/Modules/posixmodule.c
3207532075
@@ -20,6 +20,8 @@
@@ -32105,7 +32105,61 @@ index 58cb9b0d46..4a2ae3f024 100644
3210532105

3210632106
/*[clinic input]
3210732107
# one of the few times we lie about this name!
32108-
@@ -1309,7 +1328,9 @@
32108+
@@ -429,35 +448,43 @@
32109+
}
32110+
}
32111+
}
32112+
+#endif
32113+
32114+
void
32115+
PyOS_BeforeFork(void)
32116+
{
32117+
+#ifdef HAVE_FORK
32118+
run_at_forkers(PyThreadState_Get()->interp->before_forkers, 1);
32119+
32120+
_PyImport_AcquireLock();
32121+
+#endif
32122+
}
32123+
32124+
void
32125+
PyOS_AfterFork_Parent(void)
32126+
{
32127+
+#ifdef HAVE_FORK
32128+
if (_PyImport_ReleaseLock() <= 0)
32129+
Py_FatalError("failed releasing import lock after fork");
32130+
32131+
run_at_forkers(PyThreadState_Get()->interp->after_forkers_parent, 0);
32132+
+#endif
32133+
}
32134+
32135+
void
32136+
PyOS_AfterFork_Child(void)
32137+
{
32138+
+#ifdef HAVE_FORK
32139+
_PyGILState_Reinit();
32140+
PyEval_ReInitThreads();
32141+
_PyImport_ReInitLock();
32142+
_PySignal_AfterFork();
32143+
32144+
run_at_forkers(PyThreadState_Get()->interp->after_forkers_child, 0);
32145+
+#endif
32146+
}
32147+
32148+
+#ifdef HAVE_FORK
32149+
static int
32150+
register_at_forker(PyObject **lst, PyObject *func)
32151+
{
32152+
@@ -476,9 +503,7 @@
32153+
void
32154+
PyOS_AfterFork(void)
32155+
{
32156+
-#ifdef HAVE_FORK
32157+
PyOS_AfterFork_Child();
32158+
-#endif
32159+
}
32160+
32161+
32162+
@@ -1309,7 +1334,9 @@
3210932163
#include <crt_externs.h>
3211032164
static char **environ;
3211132165
#elif !defined(_MSC_VER) && ( !defined(__WATCOMC__) || defined(__QNX__) )
@@ -32115,7 +32169,7 @@ index 58cb9b0d46..4a2ae3f024 100644
3211532169
#endif /* !_MSC_VER */
3211632170

3211732171
static PyObject *
32118-
@@ -1360,7 +1381,7 @@
32172+
@@ -1360,7 +1387,7 @@
3211932173
Py_DECREF(k);
3212032174
Py_DECREF(v);
3212132175
}
@@ -32124,7 +32178,7 @@ index 58cb9b0d46..4a2ae3f024 100644
3212432178
if (environ == NULL)
3212532179
return d;
3212632180
/* This part ignores errors */
32127-
@@ -4221,7 +4242,12 @@
32181+
@@ -4221,7 +4248,12 @@
3212832182
long result;
3212932183
const char *bytes = PyBytes_AsString(command);
3213032184
Py_BEGIN_ALLOW_THREADS
@@ -32137,7 +32191,7 @@ index 58cb9b0d46..4a2ae3f024 100644
3213732191
Py_END_ALLOW_THREADS
3213832192
return result;
3213932193
}
32140-
@@ -4498,7 +4524,7 @@
32194+
@@ -4498,7 +4530,7 @@
3214132195
static int
3214232196
utime_dir_fd(utime_t *ut, int dir_fd, const char *path, int follow_symlinks)
3214332197
{
@@ -32146,7 +32200,7 @@ index 58cb9b0d46..4a2ae3f024 100644
3214632200
int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
3214732201
UTIME_TO_TIMESPEC;
3214832202
return utimensat(dir_fd, path, time, flags);
32149-
@@ -4524,7 +4550,7 @@
32203+
@@ -4524,7 +4556,7 @@
3215032204
static int
3215132205
utime_fd(utime_t *ut, int fd)
3215232206
{
@@ -32155,7 +32209,7 @@ index 58cb9b0d46..4a2ae3f024 100644
3215532209
UTIME_TO_TIMESPEC;
3215632210
return futimens(fd, time);
3215732211
#else
32158-
@@ -4547,7 +4573,7 @@
32212+
@@ -4547,7 +4579,7 @@
3215932213
static int
3216032214
utime_nofollow_symlinks(utime_t *ut, const char *path)
3216132215
{
@@ -32164,7 +32218,7 @@ index 58cb9b0d46..4a2ae3f024 100644
3216432218
UTIME_TO_TIMESPEC;
3216532219
return utimensat(DEFAULT_DIR_FD, path, time, AT_SYMLINK_NOFOLLOW);
3216632220
#else
32167-
@@ -4563,7 +4589,7 @@
32221+
@@ -4563,7 +4595,7 @@
3216832222
static int
3216932223
utime_default(utime_t *ut, const char *path)
3217032224
{

0 commit comments

Comments
 (0)