summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r--Objects/fileobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 90c9687..1880187 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -354,6 +354,8 @@ PyFile_SetEncoding(PyObject *f, const char *enc)
{
PyFileObject *file = (PyFileObject*)f;
PyObject *str = PyString_FromString(enc);
+
+ assert(PyFile_Check(f));
if (!str)
return 0;
Py_DECREF(file->f_encoding);