Register Common.error with local scheduler extension module. (#1316)

* Register Common.error with local scheduler extension module.

* Add test.
This commit is contained in:
Robert Nishihara
2017-12-13 11:55:54 -08:00
committed by Philipp Moritz
parent b6a35e0395
commit f75b51d178
3 changed files with 24 additions and 6 deletions
@@ -287,10 +287,10 @@ MOD_INIT(liblocal_scheduler_library) {
g_task_builder = make_task_builder();
char local_scheduler_error[] = "local_scheduler.error";
LocalSchedulerError = PyErr_NewException(local_scheduler_error, NULL, NULL);
Py_INCREF(LocalSchedulerError);
PyModule_AddObject(m, "local_scheduler_error", LocalSchedulerError);
char common_error[] = "common.error";
CommonError = PyErr_NewException(common_error, NULL, NULL);
Py_INCREF(CommonError);
PyModule_AddObject(m, "common_error", CommonError);
Py_INCREF(&PyRayConfigType);
PyModule_AddObject(m, "RayConfig", (PyObject *) &PyRayConfigType);