mirror of
https://github.com/xtacocorex/CHIP_IO
synced 2025-07-20 04:43:21 +00:00
new method for determining if the computer is a chip/chip pro, this fixes the runtimeerror's i was getting. for #32
This commit is contained in:
@ -55,15 +55,6 @@ static PyObject *py_cleanup(PyObject *self, PyObject *args)
|
||||
static int init_module(void)
|
||||
{
|
||||
clear_error_msg();
|
||||
|
||||
// figure out if we're a chip pro
|
||||
if (is_this_chippro() < 1) {
|
||||
char err[2000];
|
||||
snprintf(err, sizeof(err), "init_module error (%s)", get_error_msg());
|
||||
PyErr_SetString(PyExc_RuntimeError, err);
|
||||
return 0;
|
||||
}
|
||||
// After this point, ISCHIPPRO variable should be good to go
|
||||
|
||||
// If we make it here, we're good to go
|
||||
if (DEBUG)
|
||||
@ -77,12 +68,8 @@ static int init_module(void)
|
||||
static PyObject *py_is_chip_pro(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *py_value;
|
||||
|
||||
if (!module_setup) {
|
||||
init_module();
|
||||
}
|
||||
|
||||
py_value = Py_BuildValue("i", ISCHIPPRO);
|
||||
py_value = Py_BuildValue("i", is_this_chippro());
|
||||
|
||||
return py_value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user