summaryrefslogtreecommitdiff
path: root/Python/fileutils.c
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-04-16 09:29:17 +0000
committerMartin Panter <vadmium+py@gmail.com>2016-04-16 09:29:17 +0000
commit89fc13946d3ac76d75882da3dd0167d7581ffe7f (patch)
tree4192ca617e21e01329e5bfae7d01f785fd0c08c3 /Python/fileutils.c
parent84f52017167324c1dbeba3ba97706458d7c46125 (diff)
parent369a3c3cb5745efd9d3c45c009b42e97c82517a6 (diff)
downloadcpython-89fc13946d3ac76d75882da3dd0167d7581ffe7f.tar.gz
Merge typo fixes from 3.5
Diffstat (limited to 'Python/fileutils.c')
-rw-r--r--Python/fileutils.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 06d632a28e..a710c99129 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -683,6 +683,10 @@ _Py_fstat(int fd, struct _Py_stat_struct *status)
{
int res;
+#ifdef WITH_THREAD
+ assert(PyGILState_Check());
+#endif
+
Py_BEGIN_ALLOW_THREADS
res = _Py_fstat_noraise(fd, status);
Py_END_ALLOW_THREADS
@@ -1164,6 +1168,10 @@ _Py_read(int fd, void *buf, size_t count)
int err;
int async_err = 0;
+#ifdef WITH_THREAD
+ assert(PyGILState_Check());
+#endif
+
/* _Py_read() must not be called with an exception set, otherwise the
* caller may think that read() was interrupted by a signal and the signal
* handler raised an exception. */
@@ -1319,6 +1327,10 @@ _Py_write_impl(int fd, const void *buf, size_t count, int gil_held)
Py_ssize_t
_Py_write(int fd, const void *buf, size_t count)
{
+#ifdef WITH_THREAD
+ assert(PyGILState_Check());
+#endif
+
/* _Py_write() must not be called with an exception set, otherwise the
* caller may think that write() was interrupted by a signal and the signal
* handler raised an exception. */
@@ -1468,6 +1480,10 @@ _Py_dup(int fd)
DWORD ftype;
#endif
+#ifdef WITH_THREAD
+ assert(PyGILState_Check());
+#endif
+
if (!_PyVerify_fd(fd)) {
PyErr_SetFromErrno(PyExc_OSError);
return -1;