Skip to content

Commit

Permalink
Fix typing with newer types-psycopg2
Browse files Browse the repository at this point in the history
Since `connection` is no longer exported from psycopg2 stubs, it's
not possible to specify explicit type. Howerver, mypy does the right
job to guess the type, so we can omit explicit annotation.
  • Loading branch information
AMDmi3 committed Oct 18, 2023
1 parent c06560a commit 3b9c778
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions repologyapp/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@


class Database:
_db: 'psycopg2.connection'

def __init__(self, dsn: str, querymgr: QueryManager, readonly: bool = True, autocommit: bool = False, application_name: str | None = None) -> None:
self._db = psycopg2.connect(dsn, application_name=application_name)
self._db.set_session(readonly=readonly, autocommit=autocommit)
Expand Down

0 comments on commit 3b9c778

Please sign in to comment.