mirror of
https://github.com/zrax/pycdc.git
synced 2026-06-23 11:34:07 +00:00
Make cast() checked by default and add try_cast() for cases where a cast
is not required to be successful.
This commit is contained in:
parent
305494c4b2
commit
ffeabc3d3f
6 changed files with 36 additions and 38 deletions
|
|
@ -213,7 +213,7 @@ void PycModule::loadFromFile(const char* filename)
|
|||
in.get32(); // Size parameter added in Python 3.3
|
||||
}
|
||||
|
||||
m_code = LoadObject(&in, this).require_cast<PycCode>();
|
||||
m_code = LoadObject(&in, this).cast<PycCode>();
|
||||
}
|
||||
|
||||
void PycModule::loadFromMarshalledFile(const char* filename, int major, int minor)
|
||||
|
|
@ -230,7 +230,7 @@ void PycModule::loadFromMarshalledFile(const char* filename, int major, int mino
|
|||
m_maj = major;
|
||||
m_min = minor;
|
||||
m_unicode = (major >= 3);
|
||||
m_code = LoadObject(&in, this).require_cast<PycCode>();
|
||||
m_code = LoadObject(&in, this).cast<PycCode>();
|
||||
}
|
||||
|
||||
PycRef<PycString> PycModule::getIntern(int ref) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue