mirror of
https://github.com/zrax/pycdc.git
synced 2026-06-23 11:34:07 +00:00
Adjust CO_FUTURE_ flags to match Python 3.8 changes, and add some missing flags
Fixes #504
This commit is contained in:
parent
0b45b5fa07
commit
0942dec653
2 changed files with 30 additions and 17 deletions
|
|
@ -64,6 +64,13 @@ void PycCode::load(PycData* stream, PycModule* mod)
|
|||
else
|
||||
m_flags = 0;
|
||||
|
||||
if (mod->verCompare(3, 8) < 0) {
|
||||
// Remap flags to new values introduced in 3.8
|
||||
if (m_flags & 0xF0000000)
|
||||
throw std::runtime_error("Cannot remap unexpected flags");
|
||||
m_flags = (m_flags & 0xFFFF) | ((m_flags & 0xFFF0000) << 4);
|
||||
}
|
||||
|
||||
m_code = LoadObject(stream, mod).cast<PycString>();
|
||||
m_consts = LoadObject(stream, mod).cast<PycSequence>();
|
||||
m_names = LoadObject(stream, mod).cast<PycSequence>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue