Make cosmetic refactoring

This commit is contained in:
Roman Mogylatov 2021-02-01 09:33:42 -05:00
parent 090f535e7c
commit fa5fd0be29
2 changed files with 82 additions and 83 deletions

View File

@ -79425,7 +79425,7 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
*
* while len(to_visit) > 0: # <<<<<<<<<<<<<<
* visiting = to_visit.pop()
*
* visited.add(visiting)
*/
while (1) {
__pyx_t_3 = PySet_GET_SIZE(__pyx_cur_scope->__pyx_v_to_visit); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 4007, __pyx_L1_error)
@ -79436,8 +79436,8 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
*
* while len(to_visit) > 0:
* visiting = to_visit.pop() # <<<<<<<<<<<<<<
*
* visited.add(visiting)
*
*/
__pyx_t_1 = PySet_Pop(__pyx_cur_scope->__pyx_v_to_visit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
@ -79446,31 +79446,31 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":4010
/* "dependency_injector/providers.pyx":4009
* while len(to_visit) > 0:
* visiting = to_visit.pop()
*
* visited.add(visiting) # <<<<<<<<<<<<<<
*
* for child in visiting.related:
*/
__pyx_t_4 = PySet_Add(__pyx_cur_scope->__pyx_v_visited, __pyx_cur_scope->__pyx_v_visiting); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 4010, __pyx_L1_error)
__pyx_t_4 = PySet_Add(__pyx_cur_scope->__pyx_v_visited, __pyx_cur_scope->__pyx_v_visiting); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 4009, __pyx_L1_error)
/* "dependency_injector/providers.pyx":4012
/* "dependency_injector/providers.pyx":4011
* visited.add(visiting)
*
* for child in visiting.related: # <<<<<<<<<<<<<<
* if child in visited:
* continue
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_visiting, __pyx_n_s_related); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4012, __pyx_L1_error)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_visiting, __pyx_n_s_related); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4011, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
__pyx_t_6 = NULL;
} else {
__pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4012, __pyx_L1_error)
__pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4011, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4012, __pyx_L1_error)
__pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4011, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
@ -79478,17 +79478,17 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 4012, __pyx_L1_error)
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 4011, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4012, __pyx_L1_error)
__pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4011, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 4012, __pyx_L1_error)
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 4011, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4012, __pyx_L1_error)
__pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4011, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
@ -79498,7 +79498,7 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(1, 4012, __pyx_L1_error)
else __PYX_ERR(1, 4011, __pyx_L1_error)
}
break;
}
@ -79509,18 +79509,18 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":4013
/* "dependency_injector/providers.pyx":4012
*
* for child in visiting.related:
* if child in visited: # <<<<<<<<<<<<<<
* continue
* to_visit.add(child)
*/
__pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_cur_scope->__pyx_v_child, __pyx_cur_scope->__pyx_v_visited, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4013, __pyx_L1_error)
__pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_cur_scope->__pyx_v_child, __pyx_cur_scope->__pyx_v_visited, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4012, __pyx_L1_error)
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
/* "dependency_injector/providers.pyx":4014
/* "dependency_injector/providers.pyx":4013
* for child in visiting.related:
* if child in visited:
* continue # <<<<<<<<<<<<<<
@ -79529,7 +79529,7 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
*/
goto __pyx_L7_continue;
/* "dependency_injector/providers.pyx":4013
/* "dependency_injector/providers.pyx":4012
*
* for child in visiting.related:
* if child in visited: # <<<<<<<<<<<<<<
@ -79538,16 +79538,16 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
*/
}
/* "dependency_injector/providers.pyx":4015
/* "dependency_injector/providers.pyx":4014
* if child in visited:
* continue
* to_visit.add(child) # <<<<<<<<<<<<<<
*
* if types and not isinstance(visiting, types):
*/
__pyx_t_4 = PySet_Add(__pyx_cur_scope->__pyx_v_to_visit, __pyx_cur_scope->__pyx_v_child); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 4015, __pyx_L1_error)
__pyx_t_4 = PySet_Add(__pyx_cur_scope->__pyx_v_to_visit, __pyx_cur_scope->__pyx_v_child); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 4014, __pyx_L1_error)
/* "dependency_injector/providers.pyx":4012
/* "dependency_injector/providers.pyx":4011
* visited.add(visiting)
*
* for child in visiting.related: # <<<<<<<<<<<<<<
@ -79558,26 +79558,26 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "dependency_injector/providers.pyx":4017
/* "dependency_injector/providers.pyx":4016
* to_visit.add(child)
*
* if types and not isinstance(visiting, types): # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_types); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4017, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_types); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4016, __pyx_L1_error)
if (__pyx_t_2) {
} else {
__pyx_t_7 = __pyx_t_2;
goto __pyx_L11_bool_binop_done;
}
__pyx_t_2 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_visiting, __pyx_cur_scope->__pyx_v_types); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 4017, __pyx_L1_error)
__pyx_t_2 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_visiting, __pyx_cur_scope->__pyx_v_types); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 4016, __pyx_L1_error)
__pyx_t_8 = ((!(__pyx_t_2 != 0)) != 0);
__pyx_t_7 = __pyx_t_8;
__pyx_L11_bool_binop_done:;
if (__pyx_t_7) {
/* "dependency_injector/providers.pyx":4018
/* "dependency_injector/providers.pyx":4017
*
* if types and not isinstance(visiting, types):
* continue # <<<<<<<<<<<<<<
@ -79586,7 +79586,7 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
*/
goto __pyx_L5_continue;
/* "dependency_injector/providers.pyx":4017
/* "dependency_injector/providers.pyx":4016
* to_visit.add(child)
*
* if types and not isinstance(visiting, types): # <<<<<<<<<<<<<<
@ -79595,7 +79595,7 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
*/
}
/* "dependency_injector/providers.pyx":4020
/* "dependency_injector/providers.pyx":4019
* continue
*
* yield visiting # <<<<<<<<<<<<<<
@ -79611,7 +79611,7 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
__pyx_generator->resume_label = 1;
return __pyx_r;
__pyx_L13_resume_from_yield:;
if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 4020, __pyx_L1_error)
if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 4019, __pyx_L1_error)
__pyx_L5_continue:;
}
CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
@ -79642,7 +79642,7 @@ static PyObject *__pyx_gb_19dependency_injector_9providers_26generator20(__pyx_C
return __pyx_r;
}
/* "dependency_injector/providers.pyx":4023
/* "dependency_injector/providers.pyx":4022
*
*
* def isawaitable(obj): # <<<<<<<<<<<<<<
@ -79680,7 +79680,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_27isawaitable(CYTHON_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isawaitable", 0);
/* "dependency_injector/providers.pyx":4028
/* "dependency_injector/providers.pyx":4027
* Return False for any object in Python 3.4 or below.
* """
* try: # <<<<<<<<<<<<<<
@ -79696,7 +79696,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_27isawaitable(CYTHON_
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "dependency_injector/providers.pyx":4029
/* "dependency_injector/providers.pyx":4028
* """
* try:
* return inspect.isawaitable(obj) # <<<<<<<<<<<<<<
@ -79704,9 +79704,9 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_27isawaitable(CYTHON_
* return False
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_inspect); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4029, __pyx_L3_error)
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_inspect); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4028, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isawaitable); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4029, __pyx_L3_error)
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isawaitable); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4028, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
@ -79721,14 +79721,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_27isawaitable(CYTHON_
}
__pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4029, __pyx_L3_error)
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4028, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L7_try_return;
/* "dependency_injector/providers.pyx":4028
/* "dependency_injector/providers.pyx":4027
* Return False for any object in Python 3.4 or below.
* """
* try: # <<<<<<<<<<<<<<
@ -79741,7 +79741,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_27isawaitable(CYTHON_
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "dependency_injector/providers.pyx":4030
/* "dependency_injector/providers.pyx":4029
* try:
* return inspect.isawaitable(obj)
* except AttributeError: # <<<<<<<<<<<<<<
@ -79751,12 +79751,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_27isawaitable(CYTHON_
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_t_7) {
__Pyx_AddTraceback("dependency_injector.providers.isawaitable", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(1, 4030, __pyx_L5_except_error)
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(1, 4029, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_5);
/* "dependency_injector/providers.pyx":4031
/* "dependency_injector/providers.pyx":4030
* return inspect.isawaitable(obj)
* except AttributeError:
* return False # <<<<<<<<<<<<<<
@ -79774,7 +79774,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_27isawaitable(CYTHON_
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "dependency_injector/providers.pyx":4028
/* "dependency_injector/providers.pyx":4027
* Return False for any object in Python 3.4 or below.
* """
* try: # <<<<<<<<<<<<<<
@ -79800,7 +79800,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_27isawaitable(CYTHON_
goto __pyx_L0;
}
/* "dependency_injector/providers.pyx":4023
/* "dependency_injector/providers.pyx":4022
*
*
* def isawaitable(obj): # <<<<<<<<<<<<<<
@ -79821,7 +79821,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_27isawaitable(CYTHON_
return __pyx_r;
}
/* "dependency_injector/providers.pyx":4034
/* "dependency_injector/providers.pyx":4033
*
*
* def iscoroutinefunction(obj): # <<<<<<<<<<<<<<
@ -79859,7 +79859,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_29iscoroutinefunction
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("iscoroutinefunction", 0);
/* "dependency_injector/providers.pyx":4039
/* "dependency_injector/providers.pyx":4038
* Return False for any object in Python 3.4 or below.
* """
* try: # <<<<<<<<<<<<<<
@ -79875,7 +79875,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_29iscoroutinefunction
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "dependency_injector/providers.pyx":4040
/* "dependency_injector/providers.pyx":4039
* """
* try:
* return inspect.iscoroutinefunction(obj) # <<<<<<<<<<<<<<
@ -79883,9 +79883,9 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_29iscoroutinefunction
* return False
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_inspect); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4040, __pyx_L3_error)
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_inspect); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4039, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_iscoroutinefunction); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4040, __pyx_L3_error)
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_iscoroutinefunction); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4039, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
@ -79900,14 +79900,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_29iscoroutinefunction
}
__pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4040, __pyx_L3_error)
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4039, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L7_try_return;
/* "dependency_injector/providers.pyx":4039
/* "dependency_injector/providers.pyx":4038
* Return False for any object in Python 3.4 or below.
* """
* try: # <<<<<<<<<<<<<<
@ -79920,7 +79920,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_29iscoroutinefunction
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "dependency_injector/providers.pyx":4041
/* "dependency_injector/providers.pyx":4040
* try:
* return inspect.iscoroutinefunction(obj)
* except AttributeError: # <<<<<<<<<<<<<<
@ -79930,12 +79930,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_29iscoroutinefunction
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_t_7) {
__Pyx_AddTraceback("dependency_injector.providers.iscoroutinefunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(1, 4041, __pyx_L5_except_error)
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(1, 4040, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_5);
/* "dependency_injector/providers.pyx":4042
/* "dependency_injector/providers.pyx":4041
* return inspect.iscoroutinefunction(obj)
* except AttributeError:
* return False # <<<<<<<<<<<<<<
@ -79953,7 +79953,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_29iscoroutinefunction
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "dependency_injector/providers.pyx":4039
/* "dependency_injector/providers.pyx":4038
* Return False for any object in Python 3.4 or below.
* """
* try: # <<<<<<<<<<<<<<
@ -79979,7 +79979,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_29iscoroutinefunction
goto __pyx_L0;
}
/* "dependency_injector/providers.pyx":4034
/* "dependency_injector/providers.pyx":4033
*
*
* def iscoroutinefunction(obj): # <<<<<<<<<<<<<<
@ -80000,7 +80000,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_29iscoroutinefunction
return __pyx_r;
}
/* "dependency_injector/providers.pyx":4045
/* "dependency_injector/providers.pyx":4044
*
*
* def isasyncgenfunction(obj): # <<<<<<<<<<<<<<
@ -80038,7 +80038,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_31isasyncgenfunction(
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isasyncgenfunction", 0);
/* "dependency_injector/providers.pyx":4050
/* "dependency_injector/providers.pyx":4049
* Return False for any object in Python 3.4 or below.
* """
* try: # <<<<<<<<<<<<<<
@ -80054,7 +80054,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_31isasyncgenfunction(
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "dependency_injector/providers.pyx":4051
/* "dependency_injector/providers.pyx":4050
* """
* try:
* return inspect.isasyncgenfunction(obj) # <<<<<<<<<<<<<<
@ -80062,9 +80062,9 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_31isasyncgenfunction(
* return False
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_inspect); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4051, __pyx_L3_error)
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_inspect); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4050, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isasyncgenfunction); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4051, __pyx_L3_error)
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isasyncgenfunction); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4050, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
@ -80079,14 +80079,14 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_31isasyncgenfunction(
}
__pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4051, __pyx_L3_error)
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4050, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L7_try_return;
/* "dependency_injector/providers.pyx":4050
/* "dependency_injector/providers.pyx":4049
* Return False for any object in Python 3.4 or below.
* """
* try: # <<<<<<<<<<<<<<
@ -80099,7 +80099,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_31isasyncgenfunction(
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "dependency_injector/providers.pyx":4052
/* "dependency_injector/providers.pyx":4051
* try:
* return inspect.isasyncgenfunction(obj)
* except AttributeError: # <<<<<<<<<<<<<<
@ -80108,12 +80108,12 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_31isasyncgenfunction(
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_t_7) {
__Pyx_AddTraceback("dependency_injector.providers.isasyncgenfunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(1, 4052, __pyx_L5_except_error)
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(1, 4051, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_5);
/* "dependency_injector/providers.pyx":4053
/* "dependency_injector/providers.pyx":4052
* return inspect.isasyncgenfunction(obj)
* except AttributeError:
* return False # <<<<<<<<<<<<<<
@ -80129,7 +80129,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_31isasyncgenfunction(
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "dependency_injector/providers.pyx":4050
/* "dependency_injector/providers.pyx":4049
* Return False for any object in Python 3.4 or below.
* """
* try: # <<<<<<<<<<<<<<
@ -80155,7 +80155,7 @@ static PyObject *__pyx_pf_19dependency_injector_9providers_31isasyncgenfunction(
goto __pyx_L0;
}
/* "dependency_injector/providers.pyx":4045
/* "dependency_injector/providers.pyx":4044
*
*
* def isasyncgenfunction(obj): # <<<<<<<<<<<<<<
@ -114830,41 +114830,41 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_tuple__56);
__pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 1, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_provider, __pyx_n_s_traverse, 3999, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(1, 3999, __pyx_L1_error)
/* "dependency_injector/providers.pyx":4023
/* "dependency_injector/providers.pyx":4022
*
*
* def isawaitable(obj): # <<<<<<<<<<<<<<
* """Check if object is a coroutine function.
*
*/
__pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 4023, __pyx_L1_error)
__pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 4022, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__57);
__Pyx_GIVEREF(__pyx_tuple__57);
__pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_provider, __pyx_n_s_isawaitable, 4023, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(1, 4023, __pyx_L1_error)
__pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_provider, __pyx_n_s_isawaitable, 4022, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(1, 4022, __pyx_L1_error)
/* "dependency_injector/providers.pyx":4034
/* "dependency_injector/providers.pyx":4033
*
*
* def iscoroutinefunction(obj): # <<<<<<<<<<<<<<
* """Check if object is a coroutine function.
*
*/
__pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 4034, __pyx_L1_error)
__pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 4033, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__59);
__Pyx_GIVEREF(__pyx_tuple__59);
__pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_provider, __pyx_n_s_iscoroutinefunction, 4034, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 4034, __pyx_L1_error)
__pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_provider, __pyx_n_s_iscoroutinefunction, 4033, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 4033, __pyx_L1_error)
/* "dependency_injector/providers.pyx":4045
/* "dependency_injector/providers.pyx":4044
*
*
* def isasyncgenfunction(obj): # <<<<<<<<<<<<<<
* """Check if object is an asynchronous generator function.
*
*/
__pyx_tuple__61 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 4045, __pyx_L1_error)
__pyx_tuple__61 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 4044, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__61);
__Pyx_GIVEREF(__pyx_tuple__61);
__pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_provider, __pyx_n_s_isasyncgenfunction, 4045, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(1, 4045, __pyx_L1_error)
__pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dependency_injector_provider, __pyx_n_s_isasyncgenfunction, 4044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(1, 4044, __pyx_L1_error)
/* "(tree fragment)":1
* def __pyx_unpickle_Provider(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
@ -118183,40 +118183,40 @@ if (!__Pyx_RefNanny) {
if (PyDict_SetItem(__pyx_d, __pyx_n_s_traverse, __pyx_t_1) < 0) __PYX_ERR(1, 3999, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":4023
/* "dependency_injector/providers.pyx":4022
*
*
* def isawaitable(obj): # <<<<<<<<<<<<<<
* """Check if object is a coroutine function.
*
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_9providers_28isawaitable, NULL, __pyx_n_s_dependency_injector_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4023, __pyx_L1_error)
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_9providers_28isawaitable, NULL, __pyx_n_s_dependency_injector_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4022, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_isawaitable, __pyx_t_1) < 0) __PYX_ERR(1, 4023, __pyx_L1_error)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_isawaitable, __pyx_t_1) < 0) __PYX_ERR(1, 4022, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":4034
/* "dependency_injector/providers.pyx":4033
*
*
* def iscoroutinefunction(obj): # <<<<<<<<<<<<<<
* """Check if object is a coroutine function.
*
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_9providers_30iscoroutinefunction, NULL, __pyx_n_s_dependency_injector_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4034, __pyx_L1_error)
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_9providers_30iscoroutinefunction, NULL, __pyx_n_s_dependency_injector_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4033, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_iscoroutinefunction, __pyx_t_1) < 0) __PYX_ERR(1, 4034, __pyx_L1_error)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_iscoroutinefunction, __pyx_t_1) < 0) __PYX_ERR(1, 4033, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":4045
/* "dependency_injector/providers.pyx":4044
*
*
* def isasyncgenfunction(obj): # <<<<<<<<<<<<<<
* """Check if object is an asynchronous generator function.
*
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_9providers_32isasyncgenfunction, NULL, __pyx_n_s_dependency_injector_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4045, __pyx_L1_error)
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_19dependency_injector_9providers_32isasyncgenfunction, NULL, __pyx_n_s_dependency_injector_providers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4044, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_isasyncgenfunction, __pyx_t_1) < 0) __PYX_ERR(1, 4045, __pyx_L1_error)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_isasyncgenfunction, __pyx_t_1) < 0) __PYX_ERR(1, 4044, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":1

View File

@ -4006,7 +4006,6 @@ def traverse(*providers, types=None):
while len(to_visit) > 0:
visiting = to_visit.pop()
visited.add(visiting)
for child in visiting.related: