Oren Milman added the comment: do you mean that we should fix it to raise a TypeError?
the assertion is there, but not explicitly. get_encoded_name() calls PyUnicode_FindChar(), which calls PyUnicode_READY(), which does assert(_PyUnicode_CHECK). so i get: >>> import imp >>> >>> class BadSpec: ... name = 42 ... origin = 'foo' ... >>> imp.create_dynamic(BadSpec()) Assertion failed: PyUnicode_Check(op), file ..\Objects\unicodeobject.c, line 380 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31315> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com