summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 6a9e8c9..92eff00 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -204,8 +204,8 @@ _Py_Mangle(PyObject *privateobj, PyObject *ident)
const char *p, *name = PyString_AsString(ident);
char *buffer;
size_t nlen, plen;
- if (privateobj == NULL || name == NULL || name[0] != '_' ||
- name[1] != '_') {
+ if (privateobj == NULL || !PyString_Check(privateobj) ||
+ name == NULL || name[0] != '_' || name[1] != '_') {
Py_INCREF(ident);
return ident;
}