mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Correct an accidentally removed previous patch.
This commit is contained in:
		
							parent
							
								
									4873fb2bac
								
							
						
					
					
						commit
						3a457790c7
					
				
					 1 changed files with 2 additions and 5 deletions
				
			
		|  | @ -7061,14 +7061,11 @@ static PySequenceMethods unicode_as_sequence = { | |||
|     PyUnicode_Contains, 		/* sq_contains */ | ||||
| }; | ||||
| 
 | ||||
| #define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) | ||||
| 
 | ||||
| static PyObject* | ||||
| unicode_subscript(PyUnicodeObject* self, PyObject* item) | ||||
| { | ||||
|     PyNumberMethods *nb = item->ob_type->tp_as_number; | ||||
|     if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { | ||||
|         Py_ssize_t i = nb->nb_index(item); | ||||
|     if (PyIndex_Check(item)) { | ||||
|         Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); | ||||
|         if (i == -1 && PyErr_Occurred()) | ||||
|             return NULL; | ||||
|         if (i < 0) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Marc-André Lemburg
						Marc-André Lemburg