File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1085,7 +1085,7 @@ pub trait PyValue: fmt::Debug + Sized + 'static {
10851085 fn class ( vm : & VirtualMachine ) -> PyClassRef ;
10861086
10871087 fn into_ref ( self , vm : & VirtualMachine ) -> PyRef < Self > {
1088- self . into_ref_with_type_unchecked ( Self :: class ( vm) )
1088+ self . into_ref_with_type_unchecked ( Self :: class ( vm) , None )
10891089 }
10901090
10911091 fn into_ref_with_type ( self , vm : & VirtualMachine , cls : PyClassRef ) -> PyResult < PyRef < Self > > {
@@ -1104,8 +1104,8 @@ pub trait PyValue: fmt::Debug + Sized + 'static {
11041104 }
11051105 }
11061106
1107- fn into_ref_with_type_unchecked ( self , cls : PyClassRef ) -> PyRef < Self > {
1108- PyRef :: new_ref_unchecked ( PyObject :: new ( self , cls, None ) )
1107+ fn into_ref_with_type_unchecked ( self , cls : PyClassRef , dict : Option < PyDictRef > ) -> PyRef < Self > {
1108+ PyRef :: new_ref_unchecked ( PyObject :: new ( self , cls, dict ) )
11091109 }
11101110}
11111111
Original file line number Diff line number Diff line change @@ -343,7 +343,8 @@ impl VirtualMachine {
343343 ) -> PyBaseExceptionRef {
344344 // TODO: add repr of args into logging?
345345 vm_trace ! ( "New exception created: {}" , exc_type. name) ;
346- PyBaseException :: new ( args, self ) . into_ref_with_type_unchecked ( exc_type)
346+ PyBaseException :: new ( args, self )
347+ . into_ref_with_type_unchecked ( exc_type, Some ( self . ctx . new_dict ( ) ) )
347348 }
348349
349350 /// Instantiate an exception with no arguments.
You can’t perform that action at this time.
0 commit comments