summaryrefslogtreecommitdiffstats
path: root/PC/winsound.c
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-11-07 14:29:26 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-11-07 14:29:26 (GMT)
commit4ae5f138da539d071f75764094bec8c8ce73b0fa (patch)
tree7dc3d8f09b4a1b912679235ea4875e41bd762430 /PC/winsound.c
parentbe3da38e0a84a271c1111f756a1826b786c221ad (diff)
downloadcpython-4ae5f138da539d071f75764094bec8c8ce73b0fa.zip
cpython-4ae5f138da539d071f75764094bec8c8ce73b0fa.tar.gz
cpython-4ae5f138da539d071f75764094bec8c8ce73b0fa.tar.bz2
Issue #6317: Now winsound.PlaySound only accepts unicode with MvL's approval.
Diffstat (limited to 'PC/winsound.c')
-rw-r--r--PC/winsound.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/PC/winsound.c b/PC/winsound.c
index d455848..1ed95ba 100644
--- a/PC/winsound.c
+++ b/PC/winsound.c
@@ -73,8 +73,6 @@ static PyObject *
sound_playsound(PyObject *s, PyObject *args)
{
Py_UNICODE *wsound;
- PyObject *osound;
- const char *sound;
int flags;
int ok;
@@ -95,31 +93,7 @@ sound_playsound(PyObject *s, PyObject *args)
Py_INCREF(Py_None);
return Py_None;
}
- /* Drop the argument parsing error as narrow strings
- are also valid. */
- PyErr_Clear();
- if (!PyArg_ParseTuple(args, "O&i:PlaySound",
- PyUnicode_FSConverter, &osound, &flags))
- return NULL;
- if (flags & SND_ASYNC && flags & SND_MEMORY) {
- /* Sidestep reference counting headache; unfortunately this also
- prevent SND_LOOP from memory. */
- PyErr_SetString(PyExc_RuntimeError, "Cannot play asynchronously from memory");
- Py_DECREF(osound);
- return NULL;
- }
- sound = PyBytes_AsString(osound);
- Py_BEGIN_ALLOW_THREADS
- ok = PlaySoundA(sound, NULL, flags);
- Py_END_ALLOW_THREADS
- if (!ok) {
- PyErr_SetString(PyExc_RuntimeError, "Failed to play sound");
- Py_DECREF(osound);
- return NULL;
- }
- Py_DECREF(osound);
- Py_INCREF(Py_None);
- return Py_None;
+ return NULL;
}
static PyObject *