mirror of
				https://github.com/psycopg/psycopg2.git
				synced 2025-11-04 09:47:30 +03:00 
			
		
		
		
	Check the presence of a mro.
The mere presence of the Py_TPFLAGS_HAVE_CLASS doesn't ensure it is there.
This commit is contained in:
		
							parent
							
								
									f0773d5682
								
							
						
					
					
						commit
						a39e98f9e5
					
				| 
						 | 
					@ -8,6 +8,8 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* Avoid pointless string manipulation in NamedTupleCursor (ticket #10)
 | 
						* Avoid pointless string manipulation in NamedTupleCursor (ticket #10)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* psycopg/microprotocols.c: Check the presence of a mro.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
2010-11-08  Daniele Varrazzo  <daniele.varrazzo@gmail.com>
 | 
					2010-11-08  Daniele Varrazzo  <daniele.varrazzo@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* psycopg/microprotocols.c: use faster function to build tuples.
 | 
						* psycopg/microprotocols.c: use faster function to build tuples.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -88,7 +88,7 @@ _get_superclass_adapter(PyObject *obj, PyObject *proto)
 | 
				
			||||||
    Py_ssize_t i, ii;
 | 
					    Py_ssize_t i, ii;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    type = (PyTypeObject *)Py_TYPE(obj);
 | 
					    type = (PyTypeObject *)Py_TYPE(obj);
 | 
				
			||||||
    if (!(Py_TPFLAGS_HAVE_CLASS & type->tp_flags)) {
 | 
					    if (!((Py_TPFLAGS_HAVE_CLASS & type->tp_flags) && type->tp_mro)) {
 | 
				
			||||||
        /* has no mro */
 | 
					        /* has no mro */
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user