File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -6906,13 +6906,6 @@ posix_fdopen(PyObject *self, PyObject *args)
6906
6906
}
6907
6907
}
6908
6908
#endif
6909
- /* The dummy filename used here must be kept in sync with the value
6910
- tested against in gzip.GzipFile.__init__() - see issue #13781. */
6911
- f = PyFile_FromFile (NULL , "<fdopen>" , orgmode , fclose );
6912
- if (f == NULL ) {
6913
- PyMem_FREE (mode );
6914
- return NULL ;
6915
- }
6916
6909
Py_BEGIN_ALLOW_THREADS
6917
6910
#if !defined(MS_WINDOWS ) && defined(HAVE_FCNTL_H )
6918
6911
if (mode [0 ] == 'a' ) {
@@ -6935,6 +6928,11 @@ posix_fdopen(PyObject *self, PyObject *args)
6935
6928
PyMem_FREE (mode );
6936
6929
if (fp == NULL )
6937
6930
return posix_error ();
6931
+ /* The dummy filename used here must be kept in sync with the value
6932
+ tested against in gzip.GzipFile.__init__() - see issue #13781. */
6933
+ f = PyFile_FromFile (NULL , "<fdopen>" , orgmode , fclose );
6934
+ if (f == NULL )
6935
+ return NULL ;
6938
6936
/* We now know we will succeed, so initialize the file object. */
6939
6937
((PyFileObject * )f )-> f_fp = fp ;
6940
6938
PyFile_SetBufSize (f , bufsize );
You can’t perform that action at this time.
0 commit comments