fix python exception
This commit is contained in:
parent
f5c7a49d61
commit
2d1ce777f5
|
@ -114,7 +114,7 @@ namespace
|
||||||
int sett = setting_by_name(key);
|
int sett = setting_by_name(key);
|
||||||
if (sett < 0)
|
if (sett < 0)
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_ValueError, ("unknown name in settings_pack: " + key).c_str());
|
PyErr_SetString(PyExc_KeyError, ("unknown name in settings_pack: " + key).c_str());
|
||||||
throw_error_already_set();
|
throw_error_already_set();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ class test_session(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
s = lt.session({'unexpected-key-name': 42})
|
s = lt.session({'unexpected-key-name': 42})
|
||||||
self.assertFalse('should have thrown an exception')
|
self.assertFalse('should have thrown an exception')
|
||||||
except Exception as e:
|
except KeyError as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
def test_deprecated_settings(self):
|
def test_deprecated_settings(self):
|
||||||
|
|
Loading…
Reference in New Issue