Ticket #5161: patch_5161.diff
File patch_5161.diff, 1.0 KB (added by , 17 years ago) |
---|
-
django/db/backends/mysql/base.py
24 24 import types 25 25 import re 26 26 27 # Raise exceptions for database warnings if DEBUG is on 28 if settings.DEBUG: 29 from warnings import filterwarnings 30 filterwarnings("error", category=Database.Warning) 31 27 32 DatabaseError = Database.DatabaseError 28 33 IntegrityError = Database.IntegrityError 29 34 … … 153 158 return False 154 159 155 160 def _cursor(self, settings): 156 from warnings import filterwarnings157 161 if not self._valid_connection(): 158 162 kwargs = { 159 163 'conv': django_conversions, … … 175 179 kwargs.update(self.options) 176 180 self.connection = Database.connect(**kwargs) 177 181 cursor = self.connection.cursor() 178 if settings.DEBUG:179 filterwarnings("error", category=Database.Warning)180 182 return cursor 181 183 182 184 def _rollback(self):