main.py - fixed imports for "Crypto" and "Cryptodome" (on debian)

This commit is contained in:
Oscar Krause 2022-12-27 12:21:52 +01:00
parent 7c8a113fbd
commit 52fb18dea0

View File

@ -19,8 +19,14 @@ from starlette.middleware.cors import CORSMiddleware
from starlette.responses import StreamingResponse, JSONResponse, HTMLResponse from starlette.responses import StreamingResponse, JSONResponse, HTMLResponse
from sqlalchemy import create_engine from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker from sqlalchemy.orm import sessionmaker
from Cryptodome.PublicKey import RSA # Crypto | Cryptodome on Debian
from Cryptodome.PublicKey.RSA import RsaKey # Crypto | Cryptodome on Debian try:
# Crypto | Cryptodome on Debian
from Crypto.PublicKey import RSA
from Crypto.PublicKey.RSA import RsaKey
except ModuleNotFoundError:
from Cryptodome.PublicKey import RSA
from Cryptodome.PublicKey.RSA import RsaKey
from orm import Origin, Lease, init as db_init from orm import Origin, Lease, init as db_init