Skip to content

Commit

Permalink
Issue python#28139: Fix messed up indentation
Browse files Browse the repository at this point in the history
Also update the classmethod and staticmethod doc strings and comments to
match the RST documentation.
  • Loading branch information
vadmium committed Sep 17, 2016
1 parent fd2f85d commit ca56dd4
Show file tree
Hide file tree
Showing 52 changed files with 310 additions and 310 deletions.
2 changes: 1 addition & 1 deletion Include/unicodeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;

#define Py_UNICODE_FILL(target, value, length) \
do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\
for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\
for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\
} while (0)

/* Check if substring matches at given offset. the offset must be
Expand Down
5 changes: 2 additions & 3 deletions Mac/Modules/cf/_CFmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ extern int _OptionalCFURLRefObj_Convert(PyObject *, CFURLRef *);
*/
PyObject *CFRange_New(CFRange *itself)
{

return Py_BuildValue("ll", (long)itself->location, (long)itself->length);
}

Expand All @@ -104,8 +103,8 @@ int
OptionalCFURLRefObj_Convert(PyObject *v, CFURLRef *p_itself)
{
if ( v == Py_None ) {
p_itself = NULL;
return 1;
p_itself = NULL;
return 1;
}
return CFURLRefObj_Convert(v, p_itself);
}
Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/ctl/_Ctlmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/dlg/_Dlgmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/drag/_Dragmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/evt/_Evtmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/file/_Filemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ typedef SInt16 FSIORefNum;

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/fm/_Fmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/folder/_Foldermodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/help/_Helpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/icn/_Icnmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/launch/_Launchmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/list/_Listmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/menu/_Menumodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/mlte/_Mltemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/osa/_OSAmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/qd/_Qdmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/qdoffs/_Qdoffsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/qt/_Qtmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/res/_Resmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/scrap/_Scrapmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/snd/_Sndmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/te/_TEmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
6 changes: 3 additions & 3 deletions Mac/Modules/win/_Winmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
PyErr_SetString(PyExc_NotImplementedError, \
"Not available in this shared library/OS version"); \
return NULL; \
}} while(0)


Expand Down
40 changes: 20 additions & 20 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -5396,11 +5396,11 @@ comerror_init(PyObject *self, PyObject *args)

a = PySequence_GetSlice(args, 1, PySequence_Size(args));
if (!a)
return NULL;
return NULL;
status = PyObject_SetAttrString(self, "args", a);
Py_DECREF(a);
if (status < 0)
return NULL;
return NULL;

if (PyObject_SetAttrString(self, "hresult", hresult) < 0)
return NULL;
Expand Down Expand Up @@ -5755,25 +5755,25 @@ PyObject *My_PyUnicode_FromWideChar(register const wchar_t *w,
PyUnicodeObject *unicode;

if (w == NULL) {
PyErr_BadInternalCall();
return NULL;
PyErr_BadInternalCall();
return NULL;
}

unicode = (PyUnicodeObject *)PyUnicode_FromUnicode(NULL, size);
if (!unicode)
return NULL;
return NULL;

/* Copy the wchar_t data into the new object */
#ifdef HAVE_USABLE_WCHAR_T
memcpy(unicode->str, w, size * sizeof(wchar_t));
#else
{
register Py_UNICODE *u;
register int i;
u = PyUnicode_AS_UNICODE(unicode);
/* In Python, the following line has a one-off error */
for (i = size; i > 0; i--)
*u++ = *w++;
register Py_UNICODE *u;
register int i;
u = PyUnicode_AS_UNICODE(unicode);
/* In Python, the following line has a one-off error */
for (i = size; i > 0; i--)
*u++ = *w++;
}
#endif

Expand All @@ -5785,21 +5785,21 @@ Py_ssize_t My_PyUnicode_AsWideChar(PyUnicodeObject *unicode,
Py_ssize_t size)
{
if (unicode == NULL) {
PyErr_BadInternalCall();
return -1;
PyErr_BadInternalCall();
return -1;
}
if (size > PyUnicode_GET_SIZE(unicode))
size = PyUnicode_GET_SIZE(unicode);
size = PyUnicode_GET_SIZE(unicode);
#ifdef HAVE_USABLE_WCHAR_T
memcpy(w, unicode->str, size * sizeof(wchar_t));
#else
{
register Py_UNICODE *u;
register int i;
u = PyUnicode_AS_UNICODE(unicode);
/* In Python, the following line has a one-off error */
for (i = size; i > 0; i--)
*w++ = *u++;
register Py_UNICODE *u;
register int i;
u = PyUnicode_AS_UNICODE(unicode);
/* In Python, the following line has a one-off error */
for (i = size; i > 0; i--)
*w++ = *u++;
}
#endif

Expand Down
Loading

0 comments on commit ca56dd4

Please sign in to comment.