mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Bug #1210377: close bsddb cursor correctly after NotFoundError.
This commit is contained in:
		
							parent
							
								
									9a27617239
								
							
						
					
					
						commit
						a223d2cb29
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -191,7 +191,10 @@ def _closeCursors(self, save=1):
 | 
				
			||||||
            c = self.dbc
 | 
					            c = self.dbc
 | 
				
			||||||
            self.dbc = None
 | 
					            self.dbc = None
 | 
				
			||||||
            if save:
 | 
					            if save:
 | 
				
			||||||
                self.saved_dbc_key = c.current(0,0,0)[0]
 | 
					                try:
 | 
				
			||||||
 | 
					                    self.saved_dbc_key = c.current(0,0,0)[0]
 | 
				
			||||||
 | 
					                except db.DBError:
 | 
				
			||||||
 | 
					                    pass                    
 | 
				
			||||||
            c.close()
 | 
					            c.close()
 | 
				
			||||||
            del c
 | 
					            del c
 | 
				
			||||||
        for cref in self._cursor_refs.values():
 | 
					        for cref in self._cursor_refs.values():
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue