File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -621,8 +621,6 @@ def test_divmod(self):
621621
622622 self .assertRaises (TypeError , divmod )
623623
624- # TODO: RUSTPYTHON
625- @unittest .expectedFailure
626624 def test_eval (self ):
627625 self .assertEqual (eval ('1+1' ), 2 )
628626 self .assertEqual (eval (' 1+1\n ' ), 2 )
Original file line number Diff line number Diff line change @@ -538,11 +538,14 @@ impl ExecutingFrame<'_> {
538538 }
539539 bytecode:: Instruction :: LoadNameAny ( idx) => {
540540 let name = self . code . names [ * idx as usize ] ;
541- let value = self . locals . mapping ( ) . subscript ( name, vm) . ok ( ) ;
542- self . push_value ( match value {
543- Some ( x) => x,
544- None => self . load_global_or_builtin ( name, vm) ?,
545- } ) ;
541+ let result = self . locals . mapping ( ) . subscript ( name, vm) ;
542+ match result {
543+ Ok ( x) => self . push_value ( x) ,
544+ Err ( e) if e. fast_isinstance ( vm. ctx . exceptions . key_error ) => {
545+ self . push_value ( self . load_global_or_builtin ( name, vm) ?) ;
546+ }
547+ Err ( e) => return Err ( e) ,
548+ }
546549 Ok ( None )
547550 }
548551 bytecode:: Instruction :: LoadGlobal ( idx) => {
You can’t perform that action at this time.
0 commit comments