Changeset 6229
- Timestamp:
- 09/14/07 17:05:58 (1 year ago)
- Files:
-
- django/trunk/django/db/backends/mysql/base.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/db/backends/mysql/base.py
r5983 r6229 24 24 import types 25 25 import re 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) 26 31 27 32 DatabaseError = Database.DatabaseError … … 154 159 155 160 def _cursor(self, settings): 156 from warnings import filterwarnings157 161 if not self._valid_connection(): 158 162 kwargs = { … … 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
