mirror of
				https://github.com/psycopg/psycopg2.git
				synced 2025-11-04 09:47:30 +03:00 
			
		
		
		
	Fixed error when adapt()ing None
This commit is contained in:
		
							parent
							
								
									a574321fcd
								
							
						
					
					
						commit
						0b0639dae5
					
				| 
						 | 
				
			
			@ -1,3 +1,9 @@
 | 
			
		|||
2009-03-08  Federico Di Gregorio  <fog@initd.org>
 | 
			
		||||
 | 
			
		||||
	* microprotocols.c: None is always adapted to NULL to avoid
 | 
			
		||||
	errors when calling adapt on nested types without first checking
 | 
			
		||||
	for None.
 | 
			
		||||
 | 
			
		||||
2009-03-02  Federico Di Gregorio  <fog@initd.org>
 | 
			
		||||
 | 
			
		||||
	* Applied modified patch from Karsten Hilbert to provide a
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -79,6 +79,11 @@ microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt)
 | 
			
		|||
       because the ISQLQuote type is abstract and there is no way to get a
 | 
			
		||||
       quotable object to be its instance */
 | 
			
		||||
       
 | 
			
		||||
    /* None is always adapted to NULL */
 | 
			
		||||
    
 | 
			
		||||
    if (obj == Py_None)
 | 
			
		||||
        return PyString_FromString("NULL");
 | 
			
		||||
 | 
			
		||||
    Dprintf("microprotocols_adapt: trying to adapt %s", obj->ob_type->tp_name);
 | 
			
		||||
 | 
			
		||||
    /* look for an adapter in the registry */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user