| 3209 | } |
| 3210 | |
| 3211 | static PyObject* createReply(RedisModuleCallReply *reply){ |
| 3212 | PyObject* res = NULL; |
| 3213 | if(!reply || RedisModule_CallReplyType(reply) == REDISMODULE_REPLY_UNKNOWN){ |
| 3214 | if(errno){ |
| 3215 | PyErr_SetString(GearsError, strerror(errno)); |
| 3216 | }else{ |
| 3217 | PyErr_SetString(GearsError, "Failed executing command"); |
| 3218 | } |
| 3219 | res = NULL; |
| 3220 | } |
| 3221 | else if(RedisModule_CallReplyType(reply) == REDISMODULE_REPLY_ERROR){ |
| 3222 | size_t len; |
| 3223 | const char* replyStr = RedisModule_CallReplyStringPtr(reply, &len); |
| 3224 | PyErr_SetString(GearsError, replyStr); |
| 3225 | }else{ |
| 3226 | res = replyToPyList(reply); |
| 3227 | } |
| 3228 | |
| 3229 | if(reply){ |
| 3230 | RedisModule_FreeCallReply(reply); |
| 3231 | } |
| 3232 | |
| 3233 | return res; |
| 3234 | } |
| 3235 | |
| 3236 | static PyObject* executeCommand(PyObject *cls, PyObject *args){ |
| 3237 | if(PyTuple_Size(args) < 1){ |
no test coverage detected