Exceptions with no argument should not set it to 'None'
This commit is contained in:
parent
3167888187
commit
2d2691710c
@ -28,7 +28,9 @@
|
|||||||
*/
|
*/
|
||||||
static KrkValue krk_initException(int argc, const KrkValue argv[], int hasKw) {
|
static KrkValue krk_initException(int argc, const KrkValue argv[], int hasKw) {
|
||||||
KrkInstance * self = AS_INSTANCE(argv[0]);
|
KrkInstance * self = AS_INSTANCE(argv[0]);
|
||||||
krk_attachNamedValue(&self->fields, "arg", argc > 1 ? argv[1] : NONE_VAL());
|
if (argc > 1) {
|
||||||
|
krk_attachNamedValue(&self->fields, "arg", argv[1]);
|
||||||
|
}
|
||||||
return argv[0];
|
return argv[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
ValueError(None)
|
ValueError()
|
||||||
Done?
|
Done?
|
||||||
try
|
try
|
||||||
finally
|
finally
|
||||||
|
@ -12,4 +12,4 @@ Before
|
|||||||
Entering
|
Entering
|
||||||
Raising
|
Raising
|
||||||
Exiting with [<class 'type'>, <class 'ValueError'>, <class 'list'>]
|
Exiting with [<class 'type'>, <class 'ValueError'>, <class 'list'>]
|
||||||
ValueError(None)
|
ValueError()
|
||||||
|
@ -2,4 +2,4 @@ Before
|
|||||||
Entering
|
Entering
|
||||||
Raising
|
Raising
|
||||||
Exiting with [<class 'type'>, <class 'ValueError'>, <class 'list'>]
|
Exiting with [<class 'type'>, <class 'ValueError'>, <class 'list'>]
|
||||||
TypeError(None)
|
TypeError()
|
||||||
|
@ -16,4 +16,4 @@ Running finally
|
|||||||
Function exit
|
Function exit
|
||||||
with <class 'NameError'>
|
with <class 'NameError'>
|
||||||
Running finally
|
Running finally
|
||||||
NameError was not caught: NameError(None)
|
NameError was not caught: NameError()
|
||||||
|
Loading…
Reference in New Issue
Block a user