• Home
  • Raw
  • Download

Lines Matching refs:tstate

67 sys_get_object_id(PyThreadState *tstate, _Py_Identifier *key)  in sys_get_object_id()  argument
69 PyObject *sd = tstate->interp->sysdict; in sys_get_object_id()
74 _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb); in sys_get_object_id()
78 _PyErr_Restore(tstate, exc_type, exc_value, exc_tb); in sys_get_object_id()
85 PyThreadState *tstate = _PyThreadState_GET(); in _PySys_GetObjectId() local
86 return sys_get_object_id(tstate, key); in _PySys_GetObjectId()
102 PyThreadState *tstate = _PyThreadState_GET(); in PySys_GetObject() local
105 _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb); in PySys_GetObject()
106 PyObject *value = _PySys_GetObject(tstate->interp, name); in PySys_GetObject()
109 _PyErr_Restore(tstate, exc_type, exc_value, exc_tb); in PySys_GetObject()
313 _PySys_Audit(PyThreadState *tstate, const char *event, in _PySys_Audit() argument
322 int res = sys_audit_tstate(tstate, event, argFormat, vargs); in _PySys_Audit()
330 PyThreadState *tstate = _PyThreadState_GET(); in PySys_Audit() local
337 int res = sys_audit_tstate(tstate, event, argFormat, vargs); in PySys_Audit()
387 PyThreadState *tstate; in PySys_AddAuditHook() local
389 tstate = _PyRuntimeState_GetThreadState(runtime); in PySys_AddAuditHook()
392 tstate = NULL; in PySys_AddAuditHook()
397 if (tstate != NULL) { in PySys_AddAuditHook()
398 if (_PySys_Audit(tstate, "sys.addaudithook", NULL) < 0) { in PySys_AddAuditHook()
399 if (_PyErr_ExceptionMatches(tstate, PyExc_RuntimeError)) { in PySys_AddAuditHook()
401 _PyErr_Clear(tstate); in PySys_AddAuditHook()
421 if (tstate != NULL) { in PySys_AddAuditHook()
422 _PyErr_NoMemory(tstate); in PySys_AddAuditHook()
446 PyThreadState *tstate = _PyThreadState_GET(); in sys_addaudithook_impl() local
449 if (_PySys_Audit(tstate, "sys.addaudithook", NULL) < 0) { in sys_addaudithook_impl()
450 if (_PyErr_ExceptionMatches(tstate, PyExc_Exception)) { in sys_addaudithook_impl()
452 _PyErr_Clear(tstate); in sys_addaudithook_impl()
458 PyInterpreterState *interp = tstate->interp; in sys_addaudithook_impl()
481 PyThreadState *tstate = _PyThreadState_GET(); in sys_audit() local
482 _Py_EnsureTstateNotNULL(tstate); in sys_audit()
485 _PyErr_SetString(tstate, PyExc_TypeError, in sys_audit()
491 if (!should_audit(tstate->interp)) { in sys_audit()
497 _PyErr_SetString(tstate, PyExc_TypeError, in sys_audit()
502 _PyErr_Format(tstate, PyExc_TypeError, in sys_audit()
517 int res = _PySys_Audit(tstate, event, "O", auditArgs); in sys_audit()
531 PyThreadState *tstate = _PyThreadState_GET(); in sys_breakpointhook() local
532 assert(!_PyErr_Occurred(tstate)); in sys_breakpointhook()
548 _PyErr_NoMemory(tstate); in sys_breakpointhook()
577 if (_PyErr_ExceptionMatches(tstate, PyExc_ImportError)) { in sys_breakpointhook()
588 if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) { in sys_breakpointhook()
601 _PyErr_Clear(tstate); in sys_breakpointhook()
700 PyThreadState *tstate = _PyThreadState_GET(); in sys_displayhook() local
704 if (!_PyErr_Occurred(tstate)) { in sys_displayhook()
705 _PyErr_SetString(tstate, PyExc_RuntimeError, in sys_displayhook()
720 outf = sys_get_object_id(tstate, &PyId_stdout); in sys_displayhook()
722 _PyErr_SetString(tstate, PyExc_RuntimeError, "lost sys.stdout"); in sys_displayhook()
726 if (_PyErr_ExceptionMatches(tstate, PyExc_UnicodeEncodeError)) { in sys_displayhook()
730 _PyErr_Clear(tstate); in sys_displayhook()
949 call_trampoline(PyThreadState *tstate, PyObject* callback, in call_trampoline() argument
962 PyObject *result = _PyObject_FastCallTstate(tstate, callback, stack, 3); in call_trampoline()
980 PyThreadState *tstate = _PyThreadState_GET(); in profile_trampoline() local
981 PyObject *result = call_trampoline(tstate, self, frame, what, arg); in profile_trampoline()
983 _PyEval_SetProfile(tstate, NULL, NULL); in profile_trampoline()
1006 PyThreadState *tstate = _PyThreadState_GET(); in trace_trampoline() local
1007 PyObject *result = call_trampoline(tstate, callback, frame, what, arg); in trace_trampoline()
1009 _PyEval_SetTrace(tstate, NULL, NULL); in trace_trampoline()
1030 PyThreadState *tstate = _PyThreadState_GET(); in sys_settrace() local
1032 if (_PyEval_SetTrace(tstate, NULL, NULL) < 0) { in sys_settrace()
1037 if (_PyEval_SetTrace(tstate, trace_trampoline, args) < 0) { in sys_settrace()
1063 PyThreadState *tstate = _PyThreadState_GET(); in sys_gettrace_impl() local
1064 PyObject *temp = tstate->c_traceobj; in sys_gettrace_impl()
1079 PyThreadState *tstate = _PyThreadState_GET(); in sys_setprofile() local
1081 if (_PyEval_SetProfile(tstate, NULL, NULL) < 0) { in sys_setprofile()
1086 if (_PyEval_SetProfile(tstate, profile_trampoline, args) < 0) { in sys_setprofile()
1112 PyThreadState *tstate = _PyThreadState_GET(); in sys_getprofile_impl() local
1113 PyObject *temp = tstate->c_profileobj; in sys_getprofile_impl()
1182 PyThreadState *tstate = _PyThreadState_GET(); in sys_setrecursionlimit_impl() local
1185 _PyErr_SetString(tstate, PyExc_ValueError, in sys_setrecursionlimit_impl()
1199 if (tstate->recursion_depth >= new_limit) { in sys_setrecursionlimit_impl()
1200 _PyErr_Format(tstate, PyExc_RecursionError, in sys_setrecursionlimit_impl()
1203 new_limit, tstate->recursion_depth); in sys_setrecursionlimit_impl()
1228 PyThreadState *tstate = _PyThreadState_GET(); in sys_set_coroutine_origin_tracking_depth_impl() local
1230 _PyErr_SetString(tstate, PyExc_ValueError, "depth must be >= 0"); in sys_set_coroutine_origin_tracking_depth_impl()
1233 _PyEval_SetCoroutineOriginTrackingDepth(tstate, depth); in sys_set_coroutine_origin_tracking_depth_impl()
1393 get_hash_info(PyThreadState *tstate) in get_hash_info() argument
1420 if (_PyErr_Occurred(tstate)) { in get_hash_info()
1661 PyThreadState *tstate = _PyThreadState_GET(); in _PySys_GetSizeOf() local
1670 if (!_PyErr_Occurred(tstate)) { in _PySys_GetSizeOf()
1671 _PyErr_Format(tstate, PyExc_TypeError, in _PySys_GetSizeOf()
1686 if (size == -1 && _PyErr_Occurred(tstate)) in _PySys_GetSizeOf()
1690 _PyErr_SetString(tstate, PyExc_ValueError, in _PySys_GetSizeOf()
1707 PyThreadState *tstate = _PyThreadState_GET(); in sys_getsizeof() local
1716 if (size == (size_t)-1 && _PyErr_Occurred(tstate)) { in sys_getsizeof()
1718 if (dflt != NULL && _PyErr_ExceptionMatches(tstate, PyExc_TypeError)) { in sys_getsizeof()
1719 _PyErr_Clear(tstate); in sys_getsizeof()
1803 PyThreadState *tstate = _PyThreadState_GET(); in sys__getframe_impl() local
1804 PyFrameObject *f = PyThreadState_GetFrame(tstate); in sys__getframe_impl()
1806 if (_PySys_Audit(tstate, "sys._getframe", "O", f) < 0) { in sys__getframe_impl()
1818 _PyErr_SetString(tstate, PyExc_ValueError, in sys__getframe_impl()
2217 get_warnoptions(PyThreadState *tstate) in get_warnoptions() argument
2219 PyObject *warnoptions = sys_get_object_id(tstate, &PyId_warnoptions); in get_warnoptions()
2235 if (sys_set_object_id(tstate->interp, &PyId_warnoptions, warnoptions)) { in get_warnoptions()
2247 PyThreadState *tstate = _PyThreadState_GET(); in PySys_ResetWarnOptions() local
2248 if (tstate == NULL) { in PySys_ResetWarnOptions()
2253 PyObject *warnoptions = sys_get_object_id(tstate, &PyId_warnoptions); in PySys_ResetWarnOptions()
2260 _PySys_AddWarnOptionWithError(PyThreadState *tstate, PyObject *option) in _PySys_AddWarnOptionWithError() argument
2262 PyObject *warnoptions = get_warnoptions(tstate); in _PySys_AddWarnOptionWithError()
2275 PyThreadState *tstate = _PyThreadState_GET(); in PySys_AddWarnOptionUnicode() local
2276 if (_PySys_AddWarnOptionWithError(tstate, option) < 0) { in PySys_AddWarnOptionUnicode()
2278 if (tstate) { in PySys_AddWarnOptionUnicode()
2279 _PyErr_Clear(tstate); in PySys_AddWarnOptionUnicode()
2287 PyThreadState *tstate = _PyThreadState_GET(); in PySys_AddWarnOption() local
2288 if (tstate == NULL) { in PySys_AddWarnOption()
2303 PyThreadState *tstate = _PyThreadState_GET(); in PySys_HasWarnOptions() local
2304 PyObject *warnoptions = sys_get_object_id(tstate, &PyId_warnoptions); in PySys_HasWarnOptions()
2310 get_xoptions(PyThreadState *tstate) in get_xoptions() argument
2312 PyObject *xoptions = sys_get_object_id(tstate, &PyId__xoptions); in get_xoptions()
2328 if (sys_set_object_id(tstate->interp, &PyId__xoptions, xoptions)) { in get_xoptions()
2342 PyThreadState *tstate = _PyThreadState_GET(); in _PySys_AddXOptionWithError() local
2343 PyObject *opts = get_xoptions(tstate); in _PySys_AddXOptionWithError()
2377 PyThreadState *tstate = _PyThreadState_GET(); in PySys_AddXOption() local
2378 if (tstate == NULL) { in PySys_AddXOption()
2384 _PyErr_Clear(tstate); in PySys_AddXOption()
2391 PyThreadState *tstate = _PyThreadState_GET(); in PySys_GetXOptions() local
2392 return get_xoptions(tstate); in PySys_GetXOptions()
2612 make_version_info(PyThreadState *tstate) in make_version_info() argument
2650 if (_PyErr_Occurred(tstate)) { in make_version_info()
2760 _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) in _PySys_InitCore() argument
2794 SET_SYS("hash_info", get_hash_info(tstate)); in _PySys_InitCore()
2820 version_info = make_version_info(tstate); in _PySys_InitCore()
2833 SET_SYS("flags", make_flags(tstate->interp)); in _PySys_InitCore()
2868 if (_PyErr_Occurred(tstate)) { in _PySys_InitCore()
2937 _PySys_UpdateConfig(PyThreadState *tstate) in _PySys_UpdateConfig() argument
2939 PyInterpreterState *interp = tstate->interp; in _PySys_UpdateConfig()
2994 if (_PyErr_Occurred(tstate)) { in _PySys_UpdateConfig()
3037 _PySys_Create(PyThreadState *tstate, PyObject **sysmod_p) in _PySys_Create() argument
3039 assert(!_PyErr_Occurred(tstate)); in _PySys_Create()
3041 PyInterpreterState *interp = tstate->interp; in _PySys_Create()
3070 status = _PySys_InitCore(tstate, sysdict); in _PySys_Create()
3079 assert(!_PyErr_Occurred(tstate)); in _PySys_Create()
3158 PyThreadState *tstate = _PyThreadState_GET(); in PySys_SetArgvEx() local
3170 if (sys_set_object_str(tstate->interp, "argv", av) != 0) { in PySys_SetArgvEx()
3186 PyObject *sys_path = sys_get_object_id(tstate, &PyId_path); in PySys_SetArgvEx()
3274 PyThreadState *tstate = _PyThreadState_GET(); in sys_write() local
3276 _PyErr_Fetch(tstate, &error_type, &error_value, &error_traceback); in sys_write()
3277 file = sys_get_object_id(tstate, key); in sys_write()
3280 _PyErr_Clear(tstate); in sys_write()
3288 _PyErr_Restore(tstate, error_type, error_value, error_traceback); in sys_write()
3317 PyThreadState *tstate = _PyThreadState_GET(); in sys_format() local
3319 _PyErr_Fetch(tstate, &error_type, &error_value, &error_traceback); in sys_format()
3320 file = sys_get_object_id(tstate, key); in sys_format()
3324 _PyErr_Clear(tstate); in sys_format()
3331 _PyErr_Restore(tstate, error_type, error_value, error_traceback); in sys_format()