Skip to content

Commit d0b8563

Browse files
committed
Fix Python 2.6 build (no NewExceptionWithDoc)
1 parent 9ba492a commit d0b8563

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

confluent_kafka/src/confluent_kafka.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,7 @@ static PyObject *_init_cimpl (void) {
15751575
Py_INCREF(&ConsumerType);
15761576
PyModule_AddObject(m, "Consumer", (PyObject *)&ConsumerType);
15771577

1578+
#if PY_VERSION_HEX >= 0x02070000
15781579
KafkaException = PyErr_NewExceptionWithDoc(
15791580
"cimpl.KafkaException",
15801581
"Kafka exception that wraps the :py:class:`KafkaError` "
@@ -1584,6 +1585,9 @@ static PyObject *_init_cimpl (void) {
15841585
":py:class:`KafkaError` object\n"
15851586
"\n",
15861587
NULL, NULL);
1588+
#else
1589+
KafkaException = PyErr_NewException("cimpl.KafkaException", NULL, NULL);
1590+
#endif
15871591
Py_INCREF(KafkaException);
15881592
PyModule_AddObject(m, "KafkaException", KafkaException);
15891593

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy