fix python exception

This commit is contained in:
arvidn 2016-11-03 17:06:53 -04:00 committed by Arvid Norberg
parent f5c7a49d61
commit 2d1ce777f5
2 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ namespace
int sett = setting_by_name(key);
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();
}

View File

@ -169,7 +169,7 @@ class test_session(unittest.TestCase):
try:
s = lt.session({'unexpected-key-name': 42})
self.assertFalse('should have thrown an exception')
except Exception as e:
except KeyError as e:
print(e)
def test_deprecated_settings(self):