removed unused imports
fixed PyPy psycopg2 crashed in storm