ez-a-sync 0.32.26__cp39-cp39-win_amd64.whl → 0.32.27__cp39-cp39-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ez-a-sync might be problematic. Click here for more details.

Files changed (66) hide show
  1. a_sync/_smart.c +53 -39
  2. a_sync/_smart.cp39-win_amd64.pyd +0 -0
  3. a_sync/a_sync/_descriptor.c +64 -49
  4. a_sync/a_sync/_descriptor.cp39-win_amd64.pyd +0 -0
  5. a_sync/a_sync/_flags.c +13 -10
  6. a_sync/a_sync/_flags.cp39-win_amd64.pyd +0 -0
  7. a_sync/a_sync/_helpers.c +62 -47
  8. a_sync/a_sync/_helpers.cp39-win_amd64.pyd +0 -0
  9. a_sync/a_sync/_kwargs.c +33 -18
  10. a_sync/a_sync/_kwargs.cp39-win_amd64.pyd +0 -0
  11. a_sync/a_sync/abstract.c +18 -11
  12. a_sync/a_sync/abstract.cp39-win_amd64.pyd +0 -0
  13. a_sync/a_sync/base.c +177 -163
  14. a_sync/a_sync/base.cp39-win_amd64.pyd +0 -0
  15. a_sync/a_sync/flags.c +6 -3
  16. a_sync/a_sync/flags.cp39-win_amd64.pyd +0 -0
  17. a_sync/a_sync/function.c +89 -75
  18. a_sync/a_sync/function.cp39-win_amd64.pyd +0 -0
  19. a_sync/a_sync/method.c +135 -121
  20. a_sync/a_sync/method.cp39-win_amd64.pyd +0 -0
  21. a_sync/a_sync/modifiers/manager.c +55 -41
  22. a_sync/a_sync/modifiers/manager.cp39-win_amd64.pyd +0 -0
  23. a_sync/a_sync/property.c +82 -67
  24. a_sync/a_sync/property.cp39-win_amd64.pyd +0 -0
  25. a_sync/async_property/cached.c +57 -42
  26. a_sync/async_property/cached.cp39-win_amd64.pyd +0 -0
  27. a_sync/async_property/proxy.c +24 -9
  28. a_sync/async_property/proxy.cp39-win_amd64.pyd +0 -0
  29. a_sync/asyncio/as_completed.c +21 -6
  30. a_sync/asyncio/as_completed.cp39-win_amd64.pyd +0 -0
  31. a_sync/asyncio/create_task.c +32 -18
  32. a_sync/asyncio/create_task.cp39-win_amd64.pyd +0 -0
  33. a_sync/asyncio/gather.c +30 -15
  34. a_sync/asyncio/gather.cp39-win_amd64.pyd +0 -0
  35. a_sync/asyncio/igather.c +33 -19
  36. a_sync/asyncio/igather.cp39-win_amd64.pyd +0 -0
  37. a_sync/asyncio/sleep.c +19 -4
  38. a_sync/asyncio/sleep.cp39-win_amd64.pyd +0 -0
  39. a_sync/debugging.c +54 -40
  40. a_sync/debugging.cp39-win_amd64.pyd +0 -0
  41. a_sync/exceptions.c +18 -11
  42. a_sync/exceptions.cp39-win_amd64.pyd +0 -0
  43. a_sync/executor.py +44 -0
  44. a_sync/functools.c +24 -9
  45. a_sync/functools.cp39-win_amd64.pyd +0 -0
  46. a_sync/iter.c +95 -81
  47. a_sync/iter.cp39-win_amd64.pyd +0 -0
  48. a_sync/primitives/_debug.c +55 -40
  49. a_sync/primitives/_debug.cp39-win_amd64.pyd +0 -0
  50. a_sync/primitives/_loggable.c +25 -10
  51. a_sync/primitives/_loggable.cp39-win_amd64.pyd +0 -0
  52. a_sync/primitives/locks/counter.c +79 -65
  53. a_sync/primitives/locks/counter.cp39-win_amd64.pyd +0 -0
  54. a_sync/primitives/locks/event.c +70 -55
  55. a_sync/primitives/locks/event.cp39-win_amd64.pyd +0 -0
  56. a_sync/primitives/locks/prio_semaphore.c +91 -77
  57. a_sync/primitives/locks/prio_semaphore.cp39-win_amd64.pyd +0 -0
  58. a_sync/primitives/locks/semaphore.c +77 -63
  59. a_sync/primitives/locks/semaphore.cp39-win_amd64.pyd +0 -0
  60. a_sync/utils/repr.c +50 -36
  61. a_sync/utils/repr.cp39-win_amd64.pyd +0 -0
  62. {ez_a_sync-0.32.26.dist-info → ez_a_sync-0.32.27.dist-info}/METADATA +1 -1
  63. {ez_a_sync-0.32.26.dist-info → ez_a_sync-0.32.27.dist-info}/RECORD +66 -66
  64. {ez_a_sync-0.32.26.dist-info → ez_a_sync-0.32.27.dist-info}/WHEEL +0 -0
  65. {ez_a_sync-0.32.26.dist-info → ez_a_sync-0.32.27.dist-info}/licenses/LICENSE.txt +0 -0
  66. {ez_a_sync-0.32.26.dist-info → ez_a_sync-0.32.27.dist-info}/top_level.txt +0 -0
a_sync/debugging.c CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.1.2 */
1
+ /* Generated by Cython 3.1.3 */
2
2
 
3
3
  /* BEGIN: Cython Metadata
4
4
  {
@@ -30,8 +30,8 @@ END: Cython Metadata */
30
30
  #elif PY_VERSION_HEX < 0x03080000
31
31
  #error Cython requires Python 3.8+.
32
32
  #else
33
- #define __PYX_ABI_VERSION "3_1_2"
34
- #define CYTHON_HEX_VERSION 0x030102F0
33
+ #define __PYX_ABI_VERSION "3_1_3"
34
+ #define CYTHON_HEX_VERSION 0x030103F0
35
35
  #define CYTHON_FUTURE_DIVISION 1
36
36
  /* CModulePreamble */
37
37
  #include <stddef.h>
@@ -394,6 +394,9 @@ END: Cython Metadata */
394
394
  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
395
395
  #endif
396
396
  #endif
397
+ #ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME
398
+ #define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100
399
+ #endif
397
400
  #ifndef __has_attribute
398
401
  #define __has_attribute(x) 0
399
402
  #endif
@@ -2364,22 +2367,22 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs
2364
2367
  CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
2365
2368
 
2366
2369
  /* TypeImport.proto */
2367
- #ifndef __PYX_HAVE_RT_ImportType_proto_3_1_2
2368
- #define __PYX_HAVE_RT_ImportType_proto_3_1_2
2370
+ #ifndef __PYX_HAVE_RT_ImportType_proto_3_1_3
2371
+ #define __PYX_HAVE_RT_ImportType_proto_3_1_3
2369
2372
  #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2370
2373
  #include <stdalign.h>
2371
2374
  #endif
2372
2375
  #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2373
- #define __PYX_GET_STRUCT_ALIGNMENT_3_1_2(s) alignof(s)
2376
+ #define __PYX_GET_STRUCT_ALIGNMENT_3_1_3(s) alignof(s)
2374
2377
  #else
2375
- #define __PYX_GET_STRUCT_ALIGNMENT_3_1_2(s) sizeof(void*)
2378
+ #define __PYX_GET_STRUCT_ALIGNMENT_3_1_3(s) sizeof(void*)
2376
2379
  #endif
2377
- enum __Pyx_ImportType_CheckSize_3_1_2 {
2378
- __Pyx_ImportType_CheckSize_Error_3_1_2 = 0,
2379
- __Pyx_ImportType_CheckSize_Warn_3_1_2 = 1,
2380
- __Pyx_ImportType_CheckSize_Ignore_3_1_2 = 2
2380
+ enum __Pyx_ImportType_CheckSize_3_1_3 {
2381
+ __Pyx_ImportType_CheckSize_Error_3_1_3 = 0,
2382
+ __Pyx_ImportType_CheckSize_Warn_3_1_3 = 1,
2383
+ __Pyx_ImportType_CheckSize_Ignore_3_1_3 = 2
2381
2384
  };
2382
- static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_2 check_size);
2385
+ static PyTypeObject *__Pyx_ImportType_3_1_3(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_3 check_size);
2383
2386
  #endif
2384
2387
 
2385
2388
  /* GetVTable.proto */
@@ -6220,27 +6223,27 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
6220
6223
  /*--- Type import code ---*/
6221
6224
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
6222
6225
  __Pyx_GOTREF(__pyx_t_1);
6223
- __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_1_2(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
6226
+ __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_1_3(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
6224
6227
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6225
- sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyTypeObject),
6228
+ sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_3(PyTypeObject),
6226
6229
  #elif CYTHON_COMPILING_IN_LIMITED_API
6227
6230
  0, 0,
6228
6231
  #else
6229
- sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(PyHeapTypeObject),
6232
+ sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_3(PyHeapTypeObject),
6230
6233
  #endif
6231
- __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error)
6234
+ __Pyx_ImportType_CheckSize_Warn_3_1_3); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error)
6232
6235
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6233
6236
  __pyx_t_1 = PyImport_ImportModule("a_sync.iter"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error)
6234
6237
  __Pyx_GOTREF(__pyx_t_1);
6235
- __pyx_mstate->__pyx_ptype_6a_sync_4iter__ASyncGeneratorFunction = __Pyx_ImportType_3_1_2(__pyx_t_1, "a_sync.iter", "_ASyncGeneratorFunction",
6238
+ __pyx_mstate->__pyx_ptype_6a_sync_4iter__ASyncGeneratorFunction = __Pyx_ImportType_3_1_3(__pyx_t_1, "a_sync.iter", "_ASyncGeneratorFunction",
6236
6239
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6237
- sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
6240
+ sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction), __PYX_GET_STRUCT_ALIGNMENT_3_1_3(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
6238
6241
  #elif CYTHON_COMPILING_IN_LIMITED_API
6239
- sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
6242
+ sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction), __PYX_GET_STRUCT_ALIGNMENT_3_1_3(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
6240
6243
  #else
6241
- sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
6244
+ sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction), __PYX_GET_STRUCT_ALIGNMENT_3_1_3(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
6242
6245
  #endif
6243
- __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_6a_sync_4iter__ASyncGeneratorFunction) __PYX_ERR(2, 3, __pyx_L1_error)
6246
+ __Pyx_ImportType_CheckSize_Warn_3_1_3); if (!__pyx_mstate->__pyx_ptype_6a_sync_4iter__ASyncGeneratorFunction) __PYX_ERR(2, 3, __pyx_L1_error)
6244
6247
  __pyx_vtabptr_6a_sync_4iter__ASyncGeneratorFunction = (struct __pyx_vtabstruct_6a_sync_4iter__ASyncGeneratorFunction*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_6a_sync_4iter__ASyncGeneratorFunction); if (unlikely(!__pyx_vtabptr_6a_sync_4iter__ASyncGeneratorFunction)) __PYX_ERR(2, 3, __pyx_L1_error)
6245
6248
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6246
6249
  __Pyx_RefNannyFinishContext();
@@ -7158,16 +7161,15 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
7158
7161
  return -1;
7159
7162
  }
7160
7163
  /* #### Code section: init_codeobjects ### */
7161
- \
7162
- typedef struct {
7163
- unsigned int argcount : 2;
7164
- unsigned int num_posonly_args : 1;
7165
- unsigned int num_kwonly_args : 1;
7166
- unsigned int nlocals : 4;
7167
- unsigned int flags : 10;
7168
- unsigned int first_line : 7;
7169
- unsigned int line_table_length : 11;
7170
- } __Pyx_PyCode_New_function_description;
7164
+ typedef struct {
7165
+ unsigned int argcount : 2;
7166
+ unsigned int num_posonly_args : 1;
7167
+ unsigned int num_kwonly_args : 1;
7168
+ unsigned int nlocals : 4;
7169
+ unsigned int flags : 10;
7170
+ unsigned int first_line : 7;
7171
+ unsigned int line_table_length : 11;
7172
+ } __Pyx_PyCode_New_function_description;
7171
7173
  /* NewCodeObj.proto */
7172
7174
  static PyObject* __Pyx_PyCode_New(
7173
7175
  const __Pyx_PyCode_New_function_description descr,
@@ -8928,6 +8930,7 @@ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
8928
8930
  changed = 1;
8929
8931
  }
8930
8932
  #endif // CYTHON_METH_FASTCALL
8933
+ #if !CYTHON_COMPILING_IN_PYPY
8931
8934
  else if (strcmp(memb->name, "__module__") == 0) {
8932
8935
  PyObject *descr;
8933
8936
  assert(memb->type == T_OBJECT);
@@ -8942,11 +8945,13 @@ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
8942
8945
  }
8943
8946
  changed = 1;
8944
8947
  }
8948
+ #endif // !CYTHON_COMPILING_IN_PYPY
8945
8949
  }
8946
8950
  memb++;
8947
8951
  }
8948
8952
  }
8949
8953
  #endif // !CYTHON_COMPILING_IN_LIMITED_API
8954
+ #if !CYTHON_COMPILING_IN_PYPY
8950
8955
  slot = spec->slots;
8951
8956
  while (slot && slot->slot && slot->slot != Py_tp_getset)
8952
8957
  slot++;
@@ -8978,6 +8983,7 @@ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
8978
8983
  ++getset;
8979
8984
  }
8980
8985
  }
8986
+ #endif // !CYTHON_COMPILING_IN_PYPY
8981
8987
  if (changed)
8982
8988
  PyType_Modified(type);
8983
8989
  #endif // PY_VERSION_HEX > 0x030900B1
@@ -9110,7 +9116,7 @@ bad:
9110
9116
  }
9111
9117
 
9112
9118
  /* CommonTypesMetaclass */
9113
- PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
9119
+ static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
9114
9120
  return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
9115
9121
  }
9116
9122
  static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
@@ -9438,7 +9444,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) {
9438
9444
  }
9439
9445
 
9440
9446
  /* PyObjectCallMethod1 */
9441
- #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000)
9447
+ #if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
9442
9448
  static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
9443
9449
  PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
9444
9450
  Py_DECREF(method);
@@ -9446,7 +9452,7 @@ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
9446
9452
  }
9447
9453
  #endif
9448
9454
  static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
9449
- #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
9455
+ #if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
9450
9456
  PyObject *args[2] = {obj, arg};
9451
9457
  (void) __Pyx_PyObject_GetMethod;
9452
9458
  (void) __Pyx_PyObject_CallOneArg;
@@ -12269,6 +12275,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObje
12269
12275
 
12270
12276
  /* PyObjectCallMethod0 */
12271
12277
  static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
12278
+ #if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
12279
+ PyObject *args[1] = {obj};
12280
+ (void) __Pyx_PyObject_GetMethod;
12281
+ (void) __Pyx_PyObject_CallOneArg;
12282
+ (void) __Pyx_PyObject_CallNoArg;
12283
+ return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
12284
+ #else
12272
12285
  PyObject *method = NULL, *result = NULL;
12273
12286
  int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
12274
12287
  if (likely(is_method)) {
@@ -12281,6 +12294,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObje
12281
12294
  Py_DECREF(method);
12282
12295
  bad:
12283
12296
  return result;
12297
+ #endif
12284
12298
  }
12285
12299
 
12286
12300
  /* ValidateBasesTuple */
@@ -12454,10 +12468,10 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) {
12454
12468
  }
12455
12469
 
12456
12470
  /* TypeImport */
12457
- #ifndef __PYX_HAVE_RT_ImportType_3_1_2
12458
- #define __PYX_HAVE_RT_ImportType_3_1_2
12459
- static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject *module, const char *module_name, const char *class_name,
12460
- size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_2 check_size)
12471
+ #ifndef __PYX_HAVE_RT_ImportType_3_1_3
12472
+ #define __PYX_HAVE_RT_ImportType_3_1_3
12473
+ static PyTypeObject *__Pyx_ImportType_3_1_3(PyObject *module, const char *module_name, const char *class_name,
12474
+ size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_3 check_size)
12461
12475
  {
12462
12476
  PyObject *result = 0;
12463
12477
  Py_ssize_t basicsize;
@@ -12513,7 +12527,7 @@ static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject *module, const char *module
12513
12527
  module_name, class_name, size, basicsize+itemsize);
12514
12528
  goto bad;
12515
12529
  }
12516
- if (check_size == __Pyx_ImportType_CheckSize_Error_3_1_2 &&
12530
+ if (check_size == __Pyx_ImportType_CheckSize_Error_3_1_3 &&
12517
12531
  ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
12518
12532
  PyErr_Format(PyExc_ValueError,
12519
12533
  "%.200s.%.200s size changed, may indicate binary incompatibility. "
@@ -12521,7 +12535,7 @@ static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject *module, const char *module
12521
12535
  module_name, class_name, size, basicsize, basicsize+itemsize);
12522
12536
  goto bad;
12523
12537
  }
12524
- else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_1_2 && (size_t)basicsize > size) {
12538
+ else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_1_3 && (size_t)basicsize > size) {
12525
12539
  if (PyErr_WarnFormat(NULL, 0,
12526
12540
  "%.200s.%.200s size changed, may indicate binary incompatibility. "
12527
12541
  "Expected %zd from C header, got %zd from PyObject",
Binary file
a_sync/exceptions.c CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.1.2 */
1
+ /* Generated by Cython 3.1.3 */
2
2
 
3
3
  /* BEGIN: Cython Metadata
4
4
  {
@@ -29,8 +29,8 @@ END: Cython Metadata */
29
29
  #elif PY_VERSION_HEX < 0x03080000
30
30
  #error Cython requires Python 3.8+.
31
31
  #else
32
- #define __PYX_ABI_VERSION "3_1_2"
33
- #define CYTHON_HEX_VERSION 0x030102F0
32
+ #define __PYX_ABI_VERSION "3_1_3"
33
+ #define CYTHON_HEX_VERSION 0x030103F0
34
34
  #define CYTHON_FUTURE_DIVISION 1
35
35
  /* CModulePreamble */
36
36
  #include <stddef.h>
@@ -393,6 +393,9 @@ END: Cython Metadata */
393
393
  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
394
394
  #endif
395
395
  #endif
396
+ #ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME
397
+ #define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100
398
+ #endif
396
399
  #ifndef __has_attribute
397
400
  #define __has_attribute(x) 0
398
401
  #endif
@@ -2704,7 +2707,7 @@ static unsigned long __Pyx_get_runtime_version(void);
2704
2707
  static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
2705
2708
 
2706
2709
  /* VoidPtrImport.proto */
2707
- static int __Pyx_ImportVoidPtr_3_1_2(PyObject *module, const char *name, void **p, const char *sig);
2710
+ static int __Pyx_ImportVoidPtr_3_1_3(PyObject *module, const char *name, void **p, const char *sig);
2708
2711
 
2709
2712
  /* MultiPhaseInitModuleState.proto */
2710
2713
  #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
@@ -6224,9 +6227,9 @@ static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
6224
6227
  /*--- Variable import code ---*/
6225
6228
  __pyx_t_1 = PyImport_ImportModule("a_sync.a_sync.flags"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
6226
6229
  __Pyx_GOTREF(__pyx_t_1);
6227
- if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "AFFIRMATIVE_FLAGS", (void **)&__pyx_vp_6a_sync_6a_sync_5flags_AFFIRMATIVE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6228
- if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "NEGATIVE_FLAGS", (void **)&__pyx_vp_6a_sync_6a_sync_5flags_NEGATIVE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6229
- if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "VIABLE_FLAGS", (void **)&__pyx_vp_6a_sync_6a_sync_5flags_VIABLE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6230
+ if (__Pyx_ImportVoidPtr_3_1_3(__pyx_t_1, "AFFIRMATIVE_FLAGS", (void **)&__pyx_vp_6a_sync_6a_sync_5flags_AFFIRMATIVE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6231
+ if (__Pyx_ImportVoidPtr_3_1_3(__pyx_t_1, "NEGATIVE_FLAGS", (void **)&__pyx_vp_6a_sync_6a_sync_5flags_NEGATIVE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6232
+ if (__Pyx_ImportVoidPtr_3_1_3(__pyx_t_1, "VIABLE_FLAGS", (void **)&__pyx_vp_6a_sync_6a_sync_5flags_VIABLE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6230
6233
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6231
6234
  __Pyx_RefNannyFinishContext();
6232
6235
  return 0;
@@ -9867,6 +9870,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
9867
9870
  changed = 1;
9868
9871
  }
9869
9872
  #endif // CYTHON_METH_FASTCALL
9873
+ #if !CYTHON_COMPILING_IN_PYPY
9870
9874
  else if (strcmp(memb->name, "__module__") == 0) {
9871
9875
  PyObject *descr;
9872
9876
  assert(memb->type == T_OBJECT);
@@ -9881,11 +9885,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
9881
9885
  }
9882
9886
  changed = 1;
9883
9887
  }
9888
+ #endif // !CYTHON_COMPILING_IN_PYPY
9884
9889
  }
9885
9890
  memb++;
9886
9891
  }
9887
9892
  }
9888
9893
  #endif // !CYTHON_COMPILING_IN_LIMITED_API
9894
+ #if !CYTHON_COMPILING_IN_PYPY
9889
9895
  slot = spec->slots;
9890
9896
  while (slot && slot->slot && slot->slot != Py_tp_getset)
9891
9897
  slot++;
@@ -9917,6 +9923,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
9917
9923
  ++getset;
9918
9924
  }
9919
9925
  }
9926
+ #endif // !CYTHON_COMPILING_IN_PYPY
9920
9927
  if (changed)
9921
9928
  PyType_Modified(type);
9922
9929
  #endif // PY_VERSION_HEX > 0x030900B1
@@ -10049,7 +10056,7 @@ bad:
10049
10056
  }
10050
10057
 
10051
10058
  /* CommonTypesMetaclass */
10052
- PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
10059
+ static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
10053
10060
  return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
10054
10061
  }
10055
10062
  static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
@@ -12446,9 +12453,9 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt
12446
12453
  }
12447
12454
 
12448
12455
  /* VoidPtrImport */
12449
- #ifndef __PYX_HAVE_RT_ImportVoidPtr_3_1_2
12450
- #define __PYX_HAVE_RT_ImportVoidPtr_3_1_2
12451
- static int __Pyx_ImportVoidPtr_3_1_2(PyObject *module, const char *name, void **p, const char *sig) {
12456
+ #ifndef __PYX_HAVE_RT_ImportVoidPtr_3_1_3
12457
+ #define __PYX_HAVE_RT_ImportVoidPtr_3_1_3
12458
+ static int __Pyx_ImportVoidPtr_3_1_3(PyObject *module, const char *name, void **p, const char *sig) {
12452
12459
  PyObject *d = 0;
12453
12460
  PyObject *cobj = 0;
12454
12461
  d = PyObject_GetAttrString(module, "__pyx_capi__");
Binary file
a_sync/executor.py CHANGED
@@ -15,9 +15,11 @@ See Also:
15
15
  """
16
16
 
17
17
  import asyncio
18
+ import atexit
18
19
  import concurrent.futures
19
20
  import multiprocessing.context
20
21
  import queue
22
+ import signal
21
23
  import threading
22
24
  import weakref
23
25
  from asyncio import sleep
@@ -27,6 +29,47 @@ from concurrent.futures import _base, thread
27
29
  from a_sync._typing import *
28
30
  from a_sync.primitives._debug import _DebugDaemonMixin
29
31
 
32
+ # === Executor Shutdown Logic ===
33
+ # All executors (module-level and user-created) are registered for shutdown on interpreter exit and signals.
34
+ # Signal handlers are chainable: after our cleanup, the previous handler is called (unless SIG_DFL or SIG_IGN).
35
+ # This ensures compatibility with other libraries and deduplicates shutdown logic.
36
+
37
+ _EXECUTORS = set()
38
+
39
+
40
+ def register_executor(executor) -> None:
41
+ """Register an executor for shutdown on exit/signals."""
42
+ _EXECUTORS.add(executor)
43
+
44
+
45
+ def _shutdown_all_executors(*args) -> None:
46
+ """Shutdown all registered executors (non-blocking)."""
47
+ for executor in list(_EXECUTORS):
48
+ try:
49
+ executor.shutdown(wait=False)
50
+ except Exception:
51
+ pass
52
+
53
+
54
+ def _register_executor_shutdown() -> None:
55
+ """Register atexit and chainable signal handlers for executor shutdown."""
56
+ atexit.register(_shutdown_all_executors)
57
+
58
+ def make_chainable_signal_handler(signalnum):
59
+ prev_handler = signal.getsignal(signalnum)
60
+
61
+ def handler(signum, frame):
62
+ _shutdown_all_executors()
63
+ if callable(prev_handler) and prev_handler not in (signal.SIG_DFL, signal.SIG_IGN):
64
+ prev_handler(signum, frame)
65
+
66
+ signal.signal(signalnum, handler)
67
+
68
+ make_chainable_signal_handler(signal.SIGINT)
69
+ make_chainable_signal_handler(signal.SIGTERM)
70
+
71
+
72
+ _register_executor_shutdown()
30
73
 
31
74
  TEN_MINUTES = 60 * 10
32
75
 
@@ -209,6 +252,7 @@ class _AsyncExecutorMixin(concurrent.futures.Executor, _DebugDaemonMixin):
209
252
  def __init_mixin__(self):
210
253
  self.sync_mode = self._max_workers == 0
211
254
  self.__super_submit = super().submit
255
+ register_executor(self)
212
256
 
213
257
  async def _debug_daemon(self, fut: asyncio.Future, fn, *args, **kwargs) -> None:
214
258
  """
a_sync/functools.c CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.1.2 */
1
+ /* Generated by Cython 3.1.3 */
2
2
 
3
3
  /* BEGIN: Cython Metadata
4
4
  {
@@ -29,8 +29,8 @@ END: Cython Metadata */
29
29
  #elif PY_VERSION_HEX < 0x03080000
30
30
  #error Cython requires Python 3.8+.
31
31
  #else
32
- #define __PYX_ABI_VERSION "3_1_2"
33
- #define CYTHON_HEX_VERSION 0x030102F0
32
+ #define __PYX_ABI_VERSION "3_1_3"
33
+ #define CYTHON_HEX_VERSION 0x030103F0
34
34
  #define CYTHON_FUTURE_DIVISION 1
35
35
  /* CModulePreamble */
36
36
  #include <stddef.h>
@@ -393,6 +393,9 @@ END: Cython Metadata */
393
393
  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
394
394
  #endif
395
395
  #endif
396
+ #ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME
397
+ #define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100
398
+ #endif
396
399
  #ifndef __has_attribute
397
400
  #define __has_attribute(x) 0
398
401
  #endif
@@ -6316,7 +6319,7 @@ __Pyx_RefNannySetupContext("PyInit_functools", 0);
6316
6319
  (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
6317
6320
  (void)__Pyx_modinit_function_import_code(__pyx_mstate);
6318
6321
  /*--- Execution code ---*/
6319
- __Pyx_TraceStartFunc("PyInit_functools", __pyx_f[0], 1, 0, 0, 0, __PYX_ERR(0, 1, __pyx_L1_error));
6322
+ __Pyx_TraceStartFunc("PyInit_functools", __pyx_f[0], 1, 1, 0, 0, __PYX_ERR(0, 1, __pyx_L1_error));
6320
6323
 
6321
6324
  /* "a_sync/functools.pyx":1
6322
6325
  * from typing import Optional # <<<<<<<<<<<<<<
@@ -6378,7 +6381,7 @@ __Pyx_RefNannySetupContext("PyInit_functools", 0);
6378
6381
  * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6379
6382
  * def __setstate_cython__(self, __pyx_state):
6380
6383
  */
6381
- __Pyx_TraceLine(1,1,0,__PYX_ERR(2, 1, __pyx_L1_error))
6384
+ __Pyx_TraceLine(1,0,0,__PYX_ERR(2, 1, __pyx_L1_error))
6382
6385
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6a_sync_9functools_22cached_property_unsafe_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cached_property_unsafe___reduce, NULL, __pyx_mstate_global->__pyx_n_u_a_sync_functools, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1, __pyx_L1_error)
6383
6386
  __Pyx_GOTREF(__pyx_t_3);
6384
6387
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
@@ -6425,12 +6428,12 @@ __Pyx_RefNannySetupContext("PyInit_functools", 0);
6425
6428
  *
6426
6429
  *
6427
6430
  */
6428
- __Pyx_TraceLine(1,0,0,__PYX_ERR(0, 1, __pyx_L1_error))
6431
+ __Pyx_TraceLine(1,1,0,__PYX_ERR(0, 1, __pyx_L1_error))
6429
6432
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
6430
6433
  __Pyx_GOTREF(__pyx_t_3);
6431
6434
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6432
6435
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6433
- __Pyx_TraceReturnValue(Py_None, 0, 0, __PYX_ERR(0, 1, __pyx_L1_error));
6436
+ __Pyx_TraceReturnValue(Py_None, 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
6434
6437
  __Pyx_PyMonitoring_ExitScope(0);
6435
6438
 
6436
6439
  /*--- Wrapped vars code ---*/
@@ -6441,7 +6444,7 @@ __Pyx_RefNannySetupContext("PyInit_functools", 0);
6441
6444
  __Pyx_XDECREF(__pyx_t_3);
6442
6445
  __Pyx_XDECREF(__pyx_t_4);
6443
6446
  __Pyx_TraceException(__pyx_lineno, 0, 0);
6444
- __Pyx_TraceExceptionUnwind(0, 0);
6447
+ __Pyx_TraceExceptionUnwind(1, 0);
6445
6448
  if (__pyx_m) {
6446
6449
  if (__pyx_mstate->__pyx_d && stringtab_initialized) {
6447
6450
  __Pyx_AddTraceback("init a_sync.functools", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -8776,6 +8779,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
8776
8779
  changed = 1;
8777
8780
  }
8778
8781
  #endif // CYTHON_METH_FASTCALL
8782
+ #if !CYTHON_COMPILING_IN_PYPY
8779
8783
  else if (strcmp(memb->name, "__module__") == 0) {
8780
8784
  PyObject *descr;
8781
8785
  assert(memb->type == T_OBJECT);
@@ -8790,11 +8794,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
8790
8794
  }
8791
8795
  changed = 1;
8792
8796
  }
8797
+ #endif // !CYTHON_COMPILING_IN_PYPY
8793
8798
  }
8794
8799
  memb++;
8795
8800
  }
8796
8801
  }
8797
8802
  #endif // !CYTHON_COMPILING_IN_LIMITED_API
8803
+ #if !CYTHON_COMPILING_IN_PYPY
8798
8804
  slot = spec->slots;
8799
8805
  while (slot && slot->slot && slot->slot != Py_tp_getset)
8800
8806
  slot++;
@@ -8826,6 +8832,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
8826
8832
  ++getset;
8827
8833
  }
8828
8834
  }
8835
+ #endif // !CYTHON_COMPILING_IN_PYPY
8829
8836
  if (changed)
8830
8837
  PyType_Modified(type);
8831
8838
  #endif // PY_VERSION_HEX > 0x030900B1
@@ -8958,7 +8965,7 @@ bad:
8958
8965
  }
8959
8966
 
8960
8967
  /* CommonTypesMetaclass */
8961
- PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
8968
+ static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
8962
8969
  return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
8963
8970
  }
8964
8971
  static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
@@ -10256,6 +10263,13 @@ try_unpack:
10256
10263
 
10257
10264
  /* PyObjectCallMethod0 */
10258
10265
  static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
10266
+ #if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
10267
+ PyObject *args[1] = {obj};
10268
+ (void) __Pyx_PyObject_GetMethod;
10269
+ (void) __Pyx_PyObject_CallOneArg;
10270
+ (void) __Pyx_PyObject_CallNoArg;
10271
+ return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
10272
+ #else
10259
10273
  PyObject *method = NULL, *result = NULL;
10260
10274
  int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
10261
10275
  if (likely(is_method)) {
@@ -10268,6 +10282,7 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name
10268
10282
  Py_DECREF(method);
10269
10283
  bad:
10270
10284
  return result;
10285
+ #endif
10271
10286
  }
10272
10287
 
10273
10288
  /* ValidateBasesTuple */
Binary file