Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 78b71c2

Browse files
committed
On Windows, tempnam() is spelled with a leading underscore.
1 parent 832181e commit 78b71c2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Modules/posixmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4211,7 +4211,11 @@ posix_tempnam(PyObject *self, PyObject *args)
42114211

42124212
if (!PyArg_ParseTuple(args, "|zz:tempnam", &dir, &pfx))
42134213
return NULL;
4214+
#ifdef MS_WIN32
4215+
name = _tempnam(dir, pfx);
4216+
#else
42144217
name = tempnam(dir, pfx);
4218+
#endif
42154219
if (name == NULL)
42164220
return PyErr_NoMemory();
42174221
result = PyString_FromString(name);

0 commit comments

Comments
 (0)