Closed tonthon closed 11 years ago
+1. I met with this problem too.
I seems good to use try:...except for backward compatibility like::
try:
from sqlalchemy import exceptions as sqlalchemy_exceptions
except ImportError:
from sqlalchemy import exc as sqlalchemy_exceptions
What do you say?
The following could already be find in sqlalchemy 0.7.0 in the init.py file:
import sqlalchemy.exc as exceptions
It has to be verified but if formalchemy 1.4.2 depends on sqlalchemy >= 0.7 as the actual version does, no try except is needed.(pyramid_formalchemy depends on formalchemy >= 1.4.2).
tonthon, Thanks for your comment. I completely understood about it. In sqlalchymy 0.7, we can use both 'exc' and 'exceptions', but in 0.8.0b2, we can't use 'exceptions'.
Using SQLAlchemy==0.8.0b2 with pyramid-formalchemy==0.4.3 , I get the following error:
The exception module has been moved to sqlalchemy.exc, so the following
makes it work