Commit a7d948f0 authored by Stefan Behnel's avatar Stefan Behnel

allow disabling the ABC registration of the Cython Generator and Coroutine...

allow disabling the ABC registration of the Cython Generator and Coroutine types to support compiling the "abc" module in CPython's stdlib itself
parent 0f6a6779
...@@ -1585,6 +1585,10 @@ static int __Pyx_patch_abc(void); /*proto*/ ...@@ -1585,6 +1585,10 @@ static int __Pyx_patch_abc(void); /*proto*/
//////////////////// PatchGeneratorABC //////////////////// //////////////////// PatchGeneratorABC ////////////////////
//@requires: PatchModuleWithCoroutine //@requires: PatchModuleWithCoroutine
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module); /*proto*/ static PyObject* __Pyx_patch_abc_module(PyObject *module); /*proto*/
static PyObject* __Pyx_patch_abc_module(PyObject *module) { static PyObject* __Pyx_patch_abc_module(PyObject *module) {
...@@ -1607,7 +1611,7 @@ if _cython_coroutine_type is not None: ...@@ -1607,7 +1611,7 @@ if _cython_coroutine_type is not None:
static int __Pyx_patch_abc(void) { static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static int abc_patched = 0; static int abc_patched = 0;
if (!abc_patched) { if (CYTHON_REGISTER_ABCS && !abc_patched) {
PyObject *module; PyObject *module;
module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections"); module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
if (!module) { if (!module) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment