Commit ccfc1419 authored by Kevin Modzelewski's avatar Kevin Modzelewski Committed by Marius Wachtler

Don't have attrwrapper.get convert to dict-backed

The issue with django was that it called object.__dict__.__get__(unicode),
which would convert object to dict-backed, and then our shutdown logic doesn't
support that case.

The shutdown logic still doesn't support that case, and there are other ways
to convert object's __dict__ to being dict-backed, so this commit isn't a full
solution, but it seems like something we should do anyway.
parent 7fd2c60c
......@@ -2354,18 +2354,20 @@ public:
RELEASE_ASSERT(_self->cls == attrwrapper_cls, "");
AttrWrapper* self = static_cast<AttrWrapper*>(_self);
if (_key->cls != str_cls)
self->convertToDictBacked();
if (self->isDictBacked()) {
static BoxedString* get_str = getStaticString("get");
return callattrInternal<CXX, NOT_REWRITABLE>(self->getDictBacking(), get_str, LookupScope::CLASS_ONLY, NULL,
ArgPassSpec(2), _key, def, NULL, NULL, NULL);
}
RELEASE_ASSERT(_key->cls == str_cls, "");
_key = coerceUnicodeToStr<CXX>(_key);
if (_key->cls != str_cls) {
Py_DECREF(_key);
return incref(def);
}
assert(_key->cls == str_cls);
BoxedString* key = static_cast<BoxedString*>(_key);
Py_INCREF(key);
internStringMortalInplace(key);
AUTO_DECREF(key);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment