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 Sep 19, 2023
1 parent 7bd9ab4 commit 519af79
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions repology/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,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 519af79

Please sign in to comment.