This commit is contained in:
Shunsuke Shibayama 2022-12-19 21:02:01 +09:00
parent debd544fdb
commit ec4d668189
5 changed files with 25 additions and 20 deletions

View file

@ -313,7 +313,7 @@ impl CodeObj {
pub fn into_bytes(self, python_ver: PythonVersion) -> Vec<u8> {
let mut bytes = vec![DataTypePrefix::Code as u8];
bytes.append(&mut self.argcount.to_le_bytes().to_vec());
if python_ver.minor >= Some(10) {
if python_ver.minor >= Some(8) {
bytes.append(&mut self.posonlyargcount.to_le_bytes().to_vec());
}
bytes.append(&mut self.kwonlyargcount.to_le_bytes().to_vec());