Issue #28139: Fix messed up indentation
Also update the classmethod and staticmethod doc strings and comments to
match the RST documentation.
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 2977bcd..f03e488 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2923,20 +2923,20 @@
if (need<2*outlen) {
need = 2*outlen;
- }
- if (_PyString_Resize(&result, need)) {
- Py_DECREF(item);
- return NULL;
- }
- outlen = need;
- }
- memcpy(
- PyString_AS_STRING(result) + j,
- PyString_AS_STRING(item),
- reslen
- );
- j += reslen;
}
+ if (_PyString_Resize(&result, need)) {
+ Py_DECREF(item);
+ return NULL;
+ }
+ outlen = need;
+ }
+ memcpy(
+ PyString_AS_STRING(result) + j,
+ PyString_AS_STRING(item),
+ reslen
+ );
+ j += reslen;
+ }
}
Py_DECREF(item);
if (ok < 0)
@@ -3031,29 +3031,27 @@
assert(outlen >= 0);
if (need > outlen) {
- /* overallocate,
- to avoid reallocations */
+ /* overallocate, to avoid reallocations */
if (need < 2 * outlen) {
- if (outlen > PY_SSIZE_T_MAX / 2) {
- Py_DECREF(item);
- return NULL;
- } else {
- need = 2 * outlen;
- }
- }
-
- if (PyUnicode_Resize(
- &result, need) < 0) {
- Py_DECREF(item);
- goto Fail_1;
- }
- outlen = need;
- }
- memcpy(PyUnicode_AS_UNICODE(result) + j,
- PyUnicode_AS_UNICODE(item),
- reslen*sizeof(Py_UNICODE));
- j += reslen;
+ if (outlen > PY_SSIZE_T_MAX / 2) {
+ Py_DECREF(item);
+ return NULL;
+ } else {
+ need = 2 * outlen;
+ }
}
+
+ if (PyUnicode_Resize(&result, need) < 0) {
+ Py_DECREF(item);
+ goto Fail_1;
+ }
+ outlen = need;
+ }
+ memcpy(PyUnicode_AS_UNICODE(result) + j,
+ PyUnicode_AS_UNICODE(item),
+ reslen*sizeof(Py_UNICODE));
+ j += reslen;
+ }
}
Py_DECREF(item);
if (ok < 0)
diff --git a/Python/mactoolboxglue.c b/Python/mactoolboxglue.c
index a38c09a..b91be3b 100644
--- a/Python/mactoolboxglue.c
+++ b/Python/mactoolboxglue.c
@@ -356,11 +356,11 @@
\
PyObject *routinename(object cobj) { \
if (!PyMacGluePtr_##routinename) { \
- if (!PyImport_ImportModule(module)) return NULL; \
- if (!PyMacGluePtr_##routinename) { \
- PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \
- return NULL; \
- } \
+ if (!PyImport_ImportModule(module)) return NULL; \
+ if (!PyMacGluePtr_##routinename) { \
+ PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \
+ return NULL; \
+ } \
} \
return (*PyMacGluePtr_##routinename)(cobj); \
}
@@ -370,11 +370,11 @@
\
int routinename(PyObject *pyobj, object *cobj) { \
if (!PyMacGluePtr_##routinename) { \
- if (!PyImport_ImportModule(module)) return 0; \
- if (!PyMacGluePtr_##routinename) { \
- PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \
- return 0; \
- } \
+ if (!PyImport_ImportModule(module)) return 0; \
+ if (!PyMacGluePtr_##routinename) { \
+ PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \
+ return 0; \
+ } \
} \
return (*PyMacGluePtr_##routinename)(pyobj, cobj); \
}
diff --git a/Python/thread_wince.h b/Python/thread_wince.h
index b9c10da..25634b8 100644
--- a/Python/thread_wince.h
+++ b/Python/thread_wince.h
@@ -72,12 +72,12 @@
dprintf(("PyThread_allocate_lock called\n"));
if (!initialized)
- PyThread_init_thread();
+ PyThread_init_thread();
aLock = CreateEvent(NULL, /* Security attributes */
- 0, /* Manual-Reset */
+ 0, /* Manual-Reset */
1, /* Is initially signalled */
- NULL); /* Name of event */
+ NULL); /* Name of event */
dprintf(("%ld: PyThread_allocate_lock() -> %p\n", PyThread_get_thread_ident(), aLock));
@@ -117,7 +117,7 @@
#endif
if (waitResult != WAIT_OBJECT_0) {
- success = 0; /* We failed */
+ success = 0; /* We failed */
}
dprintf(("%ld: PyThread_acquire_lock(%p, %d) -> %d\n", PyThread_get_thread_ident(),aLock, waitflag, success));
@@ -130,7 +130,7 @@
dprintf(("%ld: PyThread_release_lock(%p) called\n", PyThread_get_thread_ident(),aLock));
if (!SetEvent(aLock))
- dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n", PyThread_get_thread_ident(), aLock, GetLastError()));
+ dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n", PyThread_get_thread_ident(), aLock, GetLastError()));
}