Fix PycCode incompatibility with Python 1.0

This commit is contained in:
Michael Hansen
2018-04-26 15:13:52 -07:00
parent 0c3955883f
commit 7f63529d49
3 changed files with 24 additions and 2 deletions

View File

@@ -34,6 +34,20 @@ bool PycTuple::isEqual(PycRef<PycObject> obj) const
return true;
}
PycRef<PycTuple> PycTuple::fromList(const PycRef<PycList>& obj)
{
PycRef<PycTuple> tuple = new PycTuple;
if (!tuple)
return tuple;
tuple->m_values.reserve(obj->values().size());
for (PycList::value_t::const_iterator it = obj->values().begin();
it != obj->values().end(); ++it) {
tuple->m_values.push_back(*it);
}
return tuple;
}
/* PycList */
void PycList::load(PycData* stream, PycModule* mod)