Panic on unexpected locals instead of just logging

This commit is contained in:
Daniel Watkins
2018-08-02 19:14:26 -04:00
parent b95c473121
commit e768f06d94

View File

@@ -117,12 +117,12 @@ impl fmt::Debug for Frame {
let local_str = match self.locals.borrow().kind {
PyObjectKind::Scope { ref scope } => match scope.locals.borrow().kind {
PyObjectKind::Dict { ref elements } => format!(" {:?}", elements),
ref unexpected => format!(
ref unexpected => panic!(
"locals unexpectedly not wrapping a dict! instead: {:?}",
unexpected
),
},
ref unexpected => format!("locals unexpectedly not a scope! instead: {:?}", unexpected),
ref unexpected => panic!("locals unexpectedly not a scope! instead: {:?}", unexpected),
};
write!(
f,