some substitution at the error handling part of the py_sg_inq function