aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Python/modsupport.c
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Python/modsupport.c
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Python/modsupport.c')
-rw-r--r--contrib/tools/python3/src/Python/modsupport.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/contrib/tools/python3/src/Python/modsupport.c b/contrib/tools/python3/src/Python/modsupport.c
index 13482c6508..802f795090 100644
--- a/contrib/tools/python3/src/Python/modsupport.c
+++ b/contrib/tools/python3/src/Python/modsupport.c
@@ -2,7 +2,7 @@
/* Module support implementation */
#include "Python.h"
-#include "pycore_abstract.h" // _PyIndex_Check()
+#include "pycore_abstract.h" // _PyIndex_Check()
#define FLAG_SIZE_T 1
typedef double va_double;
@@ -21,7 +21,7 @@ _Py_convert_optional_to_ssize_t(PyObject *obj, void *result)
if (obj == Py_None) {
return 1;
}
- else if (_PyIndex_Check(obj)) {
+ else if (_PyIndex_Check(obj)) {
limit = PyNumber_AsSsize_t(obj, PyExc_OverflowError);
if (limit == -1 && PyErr_Occurred()) {
return 0;
@@ -343,13 +343,13 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
++*p_format;
if (flags & FLAG_SIZE_T)
n = va_arg(*p_va, Py_ssize_t);
- else {
+ else {
n = va_arg(*p_va, int);
- if (PyErr_WarnEx(PyExc_DeprecationWarning,
- "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
- return NULL;
- }
- }
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
+ return NULL;
+ }
+ }
}
else
n = -1;
@@ -396,13 +396,13 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
++*p_format;
if (flags & FLAG_SIZE_T)
n = va_arg(*p_va, Py_ssize_t);
- else {
+ else {
n = va_arg(*p_va, int);
- if (PyErr_WarnEx(PyExc_DeprecationWarning,
- "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
- return NULL;
- }
- }
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
+ return NULL;
+ }
+ }
}
else
n = -1;
@@ -434,13 +434,13 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
++*p_format;
if (flags & FLAG_SIZE_T)
n = va_arg(*p_va, Py_ssize_t);
- else {
+ else {
n = va_arg(*p_va, int);
- if (PyErr_WarnEx(PyExc_DeprecationWarning,
- "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
- return NULL;
- }
- }
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
+ return NULL;
+ }
+ }
}
else
n = -1;
@@ -619,9 +619,9 @@ va_build_stack(PyObject **small_stack, Py_ssize_t small_stack_len,
va_end(lva);
if (res < 0) {
- if (stack != small_stack) {
- PyMem_Free(stack);
- }
+ if (stack != small_stack) {
+ PyMem_Free(stack);
+ }
return NULL;
}
@@ -682,22 +682,22 @@ PyModule_AddStringConstant(PyObject *m, const char *name, const char *value)
Py_DECREF(o);
return -1;
}
-
-int
-PyModule_AddType(PyObject *module, PyTypeObject *type)
-{
- if (PyType_Ready(type) < 0) {
- return -1;
- }
-
- const char *name = _PyType_Name(type);
- assert(name != NULL);
-
- Py_INCREF(type);
- if (PyModule_AddObject(module, name, (PyObject *)type) < 0) {
- Py_DECREF(type);
- return -1;
- }
-
- return 0;
-}
+
+int
+PyModule_AddType(PyObject *module, PyTypeObject *type)
+{
+ if (PyType_Ready(type) < 0) {
+ return -1;
+ }
+
+ const char *name = _PyType_Name(type);
+ assert(name != NULL);
+
+ Py_INCREF(type);
+ if (PyModule_AddObject(module, name, (PyObject *)type) < 0) {
+ Py_DECREF(type);
+ return -1;
+ }
+
+ return 0;
+}