Skip to content

Commit 818b985

Browse files
committed
rollback that pg8000/win change. It just caused more test failures.
1 parent 5b3f869 commit 818b985

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

  • src/relstorage/adapters/postgresql/drivers

src/relstorage/adapters/postgresql/drivers/pg8000.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
from relstorage._compat import number_types
2323

24-
from ...._compat import WIN
2524
from ...interfaces import IDBDriver
2625
from ...sql import Compiler
2726
from . import AbstractPostgreSQLDriver
@@ -245,16 +244,9 @@ def connection_may_need_commit(self, conn):
245244
def _get_exception_pgcode(self, exc):
246245
return exc.args[0]['C']
247246

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

Comments
 (0)