File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -668,8 +668,6 @@ def testChainingDescriptors(self):
668
668
e .__suppress_context__ = False
669
669
self .assertFalse (e .__suppress_context__ )
670
670
671
- # TODO: RUSTPYTHON
672
- @unittest .expectedFailure
673
671
def testKeywordArgs (self ):
674
672
# test that builtin exception don't take keyword args,
675
673
# but user-defined subclasses can if they want
Original file line number Diff line number Diff line change @@ -649,6 +649,9 @@ impl Constructor for PyBaseException {
649
649
type Args = FuncArgs ;
650
650
651
651
fn py_new ( cls : PyTypeRef , args : FuncArgs , vm : & VirtualMachine ) -> PyResult {
652
+ if cls. is ( PyBaseException :: class ( & vm. ctx ) ) && !args. kwargs . is_empty ( ) {
653
+ return Err ( vm. new_type_error ( "BaseException() takes no keyword arguments" . to_owned ( ) ) ) ;
654
+ }
652
655
PyBaseException :: new ( args. args , vm)
653
656
. into_ref_with_type ( vm, cls)
654
657
. map ( Into :: into)
You can’t perform that action at this time.
0 commit comments