|
21 | 21 |
|
22 | 22 | from relstorage._compat import number_types |
23 | 23 |
|
24 | | -from ...._compat import WIN |
25 | 24 | from ...interfaces import IDBDriver |
26 | 25 | from ...sql import Compiler |
27 | 26 | from . import AbstractPostgreSQLDriver |
@@ -245,16 +244,9 @@ def connection_may_need_commit(self, conn): |
245 | 244 | def _get_exception_pgcode(self, exc): |
246 | 245 | return exc.args[0]['C'] |
247 | 246 |
|
248 | | - if WIN: |
249 | | - def exception_is_deadlock(self, exc): |
250 | | - is_deadlock = super().exception_is_deadlock(exc) |
251 | | - if is_deadlock: |
252 | | - return is_deadlock |
253 | | - # pg8000 raises pg8000.dbapi.ProgrammingError, which is a DatabaseError. |
254 | | - # We've seen both |
255 | | - # 40P01 - deadlock_detected (Transaction Rollback) |
256 | | - # 55P03 - lock_not_available (Object Not In Prerequisite State) |
257 | | - # ERRCODE_DEADLOCK is the first one, checked by super. |
258 | | - if isinstance(exc, self.driver_module.DatabaseError): |
259 | | - return self._get_exception_pgcode(exc) == '55P03' |
260 | | - return None |
| 247 | + # pg8000 raises pg8000.dbapi.ProgrammingError, which is a DatabaseError. |
| 248 | + # We've seen both |
| 249 | + # 40P01 - deadlock_detected (Transaction Rollback) |
| 250 | + # 55P03 - lock_not_available (Object Not In Prerequisite State) |
| 251 | + # ERRCODE_DEADLOCK is the first one, checked by super. |
| 252 | + # If we treat the other one like a deadlock, a bunch of tests break. |
0 commit comments