| 2935 | } |
| 2936 | |
| 2937 | static PyObject* getGearsSession(PyObject *cls, PyObject *args){ |
| 2938 | PythonThreadCtx* ptctx = GetPythonThreadCtx(); |
| 2939 | PyObject* res; |
| 2940 | if(!ptctx->currSession){ |
| 2941 | Py_INCREF(Py_None); |
| 2942 | res = Py_None; |
| 2943 | }else{ |
| 2944 | PyExecutionSession* pyExSes = PyObject_New(PyExecutionSession, &PyExecutionSessionType); |
| 2945 | pyExSes->s = PythonSessionCtx_ShallowCopy(ptctx->currSession); |
| 2946 | pyExSes->crtCtx = getCommandReaderTriggerCtx(ptctx); |
| 2947 | pyExSes->cmdCtx = getCommandCtx(ptctx); |
| 2948 | |
| 2949 | if(pyExSes->crtCtx){ |
| 2950 | pyExSes->crtCtx = RedisGears_CommandReaderTriggerCtxGetShallowCopy(pyExSes->crtCtx); |
| 2951 | } |
| 2952 | |
| 2953 | if(pyExSes->cmdCtx){ |
| 2954 | pyExSes->cmdCtx = RedisGears_CommandCtxGetShallowCopy(pyExSes->cmdCtx); |
| 2955 | } |
| 2956 | |
| 2957 | res = (PyObject*)pyExSes; |
| 2958 | } |
| 2959 | return res; |
| 2960 | } |
| 2961 | |
| 2962 | static PyObject* isInAtomicBlock(PyObject *cls, PyObject *args){ |
| 2963 | PythonThreadCtx* ptctx = GetPythonThreadCtx(); |
no test coverage detected