MCPcopy Create free account
hub / github.com/tox-dev/filelock / _RaceCon

Class _RaceCon

tests/test_read_write_unit.py:637–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635 real_con = reader._con
636
637 class _RaceCon:
638 def execute(self, sql: str) -> object: # noqa: PLR6301
639 if sql.lstrip().upper().startswith("SELECT") and not writer._con.in_transaction:
640 writer.acquire_write() # writer slips in between the reader's BEGIN and SELECT
641 return real_con.execute(sql)
642
643 def __getattr__(self, name: str) -> object:
644 return getattr(real_con, name)
645
646 reader._con = _RaceCon() # ty: ignore[invalid-assignment]
647 with pytest.raises(Timeout):

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…