handle of ModuleNotFoundError
This commit is contained in:
pare
700ad081b4
commit
67e239ebad
S'han modificat 2 arxius amb 8 adicions i 2 eliminacions
|
@ -8,7 +8,10 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import os.path
|
import os.path
|
||||||
import psycopg2
|
import psycopg2
|
||||||
from prettytable import PrettyTable
|
try:
|
||||||
|
from prettytable import PrettyTable
|
||||||
|
except ModuleNotFoundError as mod_not_found:
|
||||||
|
print(f"{mod_not_found}. Run 'pip install -r requirements.txt' and try again")
|
||||||
|
|
||||||
def get_user(email):
|
def get_user(email):
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,10 @@ import os
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime, timezone, timedelta
|
from datetime import datetime, timezone, timedelta
|
||||||
import time
|
import time
|
||||||
import psycopg2
|
try:
|
||||||
|
import psycopg2
|
||||||
|
except ModuleNotFoundError as mod_not_found:
|
||||||
|
print(f"{mod_not_found}'. Run 'pip install -r requirements.txt' and try again")
|
||||||
from email.mime.multipart import MIMEMultipart
|
from email.mime.multipart import MIMEMultipart
|
||||||
from email.mime.text import MIMEText
|
from email.mime.text import MIMEText
|
||||||
import smtplib
|
import smtplib
|
||||||
|
|
Loading…
Referencia en una nova incidència