Make incognito a CodeFlag bit

This commit is contained in:
Noah
2020-02-08 23:23:03 -06:00
parent 5b2cfb442d
commit be565d30ae
5 changed files with 12 additions and 8 deletions

View File

@@ -281,7 +281,7 @@ impl PyFunction {
#[pyproperty(magic)]
fn globals(&self, vm: &VirtualMachine) -> PyResult<PyDictRef> {
if self.code.incognito {
if self.code.incognito() {
Err(vm.new_type_error("Can't get __globals__ on an incognito function".to_owned()))
} else {
Ok(self.scope.globals.clone())