From 52fb18dea0cc1089b863765591579347565467e4 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Tue, 27 Dec 2022 12:21:52 +0100 Subject: [PATCH] main.py - fixed imports for "Crypto" and "Cryptodome" (on debian) --- app/main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index c5970d3..75ec633 100644 --- a/app/main.py +++ b/app/main.py @@ -19,8 +19,14 @@ from starlette.middleware.cors import CORSMiddleware from starlette.responses import StreamingResponse, JSONResponse, HTMLResponse from sqlalchemy import create_engine 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