mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	Issue #28139: Merge indentation fixes from 3.5 into 3.6
This commit is contained in:
		
						commit
						d508d00919
					
				
					 7 changed files with 38 additions and 32 deletions
				
			
		| 
						 | 
					@ -160,7 +160,7 @@ typedef uint8_t Py_UCS1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define Py_UNICODE_FILL(target, value, length) \
 | 
					#define Py_UNICODE_FILL(target, value, length) \
 | 
				
			||||||
    do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\
 | 
					    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)
 | 
					    } while (0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* macros to work with surrogates */
 | 
					/* macros to work with surrogates */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,9 +54,10 @@ copy_grouping(const char* s)
 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
    PyObject *result, *val = NULL;
 | 
					    PyObject *result, *val = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (s[0] == '\0')
 | 
					    if (s[0] == '\0') {
 | 
				
			||||||
        /* empty string: no grouping at all */
 | 
					        /* empty string: no grouping at all */
 | 
				
			||||||
        return PyList_New(0);
 | 
					        return PyList_New(0);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (i = 0; s[i] != '\0' && s[i] != CHAR_MAX; i++)
 | 
					    for (i = 0; s[i] != '\0' && s[i] != CHAR_MAX; i++)
 | 
				
			||||||
        ; /* nothing */
 | 
					        ; /* nothing */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,7 @@ conv_descriptor(PyObject *object, int *target)
 | 
				
			||||||
    int fd = PyObject_AsFileDescriptor(object);
 | 
					    int fd = PyObject_AsFileDescriptor(object);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (fd < 0)
 | 
					    if (fd < 0)
 | 
				
			||||||
    return 0;
 | 
					        return 0;
 | 
				
			||||||
    *target = fd;
 | 
					    *target = fd;
 | 
				
			||||||
    return 1;
 | 
					    return 1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -154,18 +154,18 @@ itimer_retval(struct itimerval *iv)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    r = PyTuple_New(2);
 | 
					    r = PyTuple_New(2);
 | 
				
			||||||
    if (r == NULL)
 | 
					    if (r == NULL)
 | 
				
			||||||
    return NULL;
 | 
					        return NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if(!(v = PyFloat_FromDouble(double_from_timeval(&iv->it_value)))) {
 | 
					    if(!(v = PyFloat_FromDouble(double_from_timeval(&iv->it_value)))) {
 | 
				
			||||||
    Py_DECREF(r);
 | 
					        Py_DECREF(r);
 | 
				
			||||||
    return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    PyTuple_SET_ITEM(r, 0, v);
 | 
					    PyTuple_SET_ITEM(r, 0, v);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if(!(v = PyFloat_FromDouble(double_from_timeval(&iv->it_interval)))) {
 | 
					    if(!(v = PyFloat_FromDouble(double_from_timeval(&iv->it_interval)))) {
 | 
				
			||||||
    Py_DECREF(r);
 | 
					        Py_DECREF(r);
 | 
				
			||||||
    return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    PyTuple_SET_ITEM(r, 1, v);
 | 
					    PyTuple_SET_ITEM(r, 1, v);
 | 
				
			||||||
| 
						 | 
					@ -1433,9 +1433,9 @@ PyInit__signal(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined (HAVE_SETITIMER) || defined (HAVE_GETITIMER)
 | 
					#if defined (HAVE_SETITIMER) || defined (HAVE_GETITIMER)
 | 
				
			||||||
    ItimerError = PyErr_NewException("signal.ItimerError",
 | 
					    ItimerError = PyErr_NewException("signal.ItimerError",
 | 
				
			||||||
     PyExc_IOError, NULL);
 | 
					            PyExc_IOError, NULL);
 | 
				
			||||||
    if (ItimerError != NULL)
 | 
					    if (ItimerError != NULL)
 | 
				
			||||||
    PyDict_SetItemString(d, "ItimerError", ItimerError);
 | 
					        PyDict_SetItemString(d, "ItimerError", ItimerError);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CTRL_C_EVENT
 | 
					#ifdef CTRL_C_EVENT
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2061,12 +2061,13 @@ getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret)
 | 
				
			||||||
        return 1;
 | 
					        return 1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#endif /* AF_UNIX */
 | 
					#endif /* AF_UNIX */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(AF_NETLINK)
 | 
					#if defined(AF_NETLINK)
 | 
				
			||||||
       case AF_NETLINK:
 | 
					    case AF_NETLINK:
 | 
				
			||||||
       {
 | 
					    {
 | 
				
			||||||
           *len_ret = sizeof (struct sockaddr_nl);
 | 
					        *len_ret = sizeof (struct sockaddr_nl);
 | 
				
			||||||
           return 1;
 | 
					        return 1;
 | 
				
			||||||
       }
 | 
					    }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef AF_RDS
 | 
					#ifdef AF_RDS
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -674,8 +674,9 @@ PyTypeObject PyFunction_Type = {
 | 
				
			||||||
   To declare a class method, use this idiom:
 | 
					   To declare a class method, use this idiom:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     class C:
 | 
					     class C:
 | 
				
			||||||
     def f(cls, arg1, arg2, ...): ...
 | 
					         @classmethod
 | 
				
			||||||
     f = classmethod(f)
 | 
					         def f(cls, arg1, arg2, ...):
 | 
				
			||||||
 | 
					             ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   It can be called either on the class (e.g. C.f()) or on an instance
 | 
					   It can be called either on the class (e.g. C.f()) or on an instance
 | 
				
			||||||
   (e.g. C().f()); the instance is ignored except for its class.
 | 
					   (e.g. C().f()); the instance is ignored except for its class.
 | 
				
			||||||
| 
						 | 
					@ -785,8 +786,9 @@ just like an instance method receives the instance.\n\
 | 
				
			||||||
To declare a class method, use this idiom:\n\
 | 
					To declare a class method, use this idiom:\n\
 | 
				
			||||||
\n\
 | 
					\n\
 | 
				
			||||||
  class C:\n\
 | 
					  class C:\n\
 | 
				
			||||||
      def f(cls, arg1, arg2, ...): ...\n\
 | 
					      @classmethod\n\
 | 
				
			||||||
      f = classmethod(f)\n\
 | 
					      def f(cls, arg1, arg2, ...):\n\
 | 
				
			||||||
 | 
					          ...\n\
 | 
				
			||||||
\n\
 | 
					\n\
 | 
				
			||||||
It can be called either on the class (e.g. C.f()) or on an instance\n\
 | 
					It can be called either on the class (e.g. C.f()) or on an instance\n\
 | 
				
			||||||
(e.g. C().f()).  The instance is ignored except for its class.\n\
 | 
					(e.g. C().f()).  The instance is ignored except for its class.\n\
 | 
				
			||||||
| 
						 | 
					@ -857,8 +859,9 @@ PyClassMethod_New(PyObject *callable)
 | 
				
			||||||
   To declare a static method, use this idiom:
 | 
					   To declare a static method, use this idiom:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     class C:
 | 
					     class C:
 | 
				
			||||||
     def f(arg1, arg2, ...): ...
 | 
					         @staticmethod
 | 
				
			||||||
     f = staticmethod(f)
 | 
					         def f(arg1, arg2, ...):
 | 
				
			||||||
 | 
					             ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   It can be called either on the class (e.g. C.f()) or on an instance
 | 
					   It can be called either on the class (e.g. C.f()) or on an instance
 | 
				
			||||||
   (e.g. C().f()); the instance is ignored except for its class.
 | 
					   (e.g. C().f()); the instance is ignored except for its class.
 | 
				
			||||||
| 
						 | 
					@ -963,8 +966,9 @@ A static method does not receive an implicit first argument.\n\
 | 
				
			||||||
To declare a static method, use this idiom:\n\
 | 
					To declare a static method, use this idiom:\n\
 | 
				
			||||||
\n\
 | 
					\n\
 | 
				
			||||||
     class C:\n\
 | 
					     class C:\n\
 | 
				
			||||||
     def f(arg1, arg2, ...): ...\n\
 | 
					         @staticmethod\n\
 | 
				
			||||||
     f = staticmethod(f)\n\
 | 
					         def f(arg1, arg2, ...):\n\
 | 
				
			||||||
 | 
					             ...\n\
 | 
				
			||||||
\n\
 | 
					\n\
 | 
				
			||||||
It can be called either on the class (e.g. C.f()) or on an instance\n\
 | 
					It can be called either on the class (e.g. C.f()) or on an instance\n\
 | 
				
			||||||
(e.g. C().f()).  The instance is ignored except for its class.\n\
 | 
					(e.g. C().f()).  The instance is ignored except for its class.\n\
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1661,16 +1661,16 @@ SelectPythonDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 | 
				
			||||||
                    PropSheet_SetWizButtons(GetParent(hwnd),
 | 
					                    PropSheet_SetWizButtons(GetParent(hwnd),
 | 
				
			||||||
                                            PSWIZB_BACK | PSWIZB_NEXT);
 | 
					                                            PSWIZB_BACK | PSWIZB_NEXT);
 | 
				
			||||||
                    /* Get the python directory */
 | 
					                    /* Get the python directory */
 | 
				
			||||||
            ivi = (InstalledVersionInfo *)
 | 
					                    ivi = (InstalledVersionInfo *)
 | 
				
			||||||
                        SendDlgItemMessage(hwnd,
 | 
					                        SendDlgItemMessage(hwnd,
 | 
				
			||||||
                                                                IDC_VERSIONS_LIST,
 | 
					                            IDC_VERSIONS_LIST,
 | 
				
			||||||
                                                                LB_GETITEMDATA,
 | 
					                            LB_GETITEMDATA,
 | 
				
			||||||
                                                                id,
 | 
					                            id,
 | 
				
			||||||
                                                                0);
 | 
					                            0);
 | 
				
			||||||
            hkey_root = ivi->hkey;
 | 
					                    hkey_root = ivi->hkey;
 | 
				
			||||||
                                strcpy(python_dir, ivi->prefix);
 | 
					                    strcpy(python_dir, ivi->prefix);
 | 
				
			||||||
                                SetDlgItemText(hwnd, IDC_PATH, python_dir);
 | 
					                    SetDlgItemText(hwnd, IDC_PATH, python_dir);
 | 
				
			||||||
                                /* retrieve the python version and pythondll to use */
 | 
					                    /* retrieve the python version and pythondll to use */
 | 
				
			||||||
                    result = SendDlgItemMessage(hwnd, IDC_VERSIONS_LIST,
 | 
					                    result = SendDlgItemMessage(hwnd, IDC_VERSIONS_LIST,
 | 
				
			||||||
                                                 LB_GETTEXTLEN, (WPARAM)id, 0);
 | 
					                                                 LB_GETTEXTLEN, (WPARAM)id, 0);
 | 
				
			||||||
                    pbuf = (char *)malloc(result + 1);
 | 
					                    pbuf = (char *)malloc(result + 1);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue