-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
55 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from typing import Any | ||
from platform import python_implementation | ||
|
||
try: | ||
import psycopg2 | ||
except ImportError: | ||
psycopg2 = False | ||
|
||
if not psycopg2: | ||
# if there's no postgres, just go with the flow. | ||
# pylint:disable=invalid-name | ||
cursor = Any | ||
connection = Any | ||
elif python_implementation() == "PyPy": | ||
from psycopg2cffi._impl.cursor import Cursor as cursor | ||
from psycopg2cffi._impl.coonnection import Connection as connection | ||
else: | ||
from psycopg2._psycopg import cursor | ||
from psycopg2._psycopg import connection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters