summaryrefslogtreecommitdiffstats
path: root/Modules/ossaudiodev.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/ossaudiodev.c')
-rw-r--r--Modules/ossaudiodev.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c
index d2fd5c8..5423308 100644
--- a/Modules/ossaudiodev.c
+++ b/Modules/ossaudiodev.c
@@ -925,11 +925,14 @@ static PyMethodDef oss_mixer_methods[] = {
static PyObject *
oss_getattro(oss_audio_t *self, PyObject *nameobj)
{
- char *name = "";
+ const char *name = "";
PyObject * rval = NULL;
- if (PyUnicode_Check(nameobj))
- name = _PyUnicode_AsString(nameobj);
+ if (PyUnicode_Check(nameobj)) {
+ name = PyUnicode_AsUTF8(nameobj);
+ if (name == NULL)
+ return NULL;
+ }
if (strcmp(name, "closed") == 0) {
rval = (self->fd == -1) ? Py_True : Py_False;