diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-24 19:15:00 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-24 19:15:00 -0400 |
commit | 09e8c9240ca55a46104989229b1254aa349dac75 (patch) | |
tree | bee4f93b556f0c9df18cc1138209a1174e03100e /lib/sqlalchemy/orm/util.py | |
parent | 59c102413e047c989f4f588c192d1d8cd5982932 (diff) | |
download | sqlalchemy-09e8c9240ca55a46104989229b1254aa349dac75.tar.gz |
py3k fixes
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r-- | lib/sqlalchemy/orm/util.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index 5fcb15a9a..684d96d2d 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -759,7 +759,11 @@ def object_state(instance): """ try: return attributes.instance_state(instance) - except (exc.UnmappedClassError, exc.NO_STATE): + # TODO: whats the py-2/3 syntax to catch two + # different kinds of exceptions at once ? + except exc.UnmappedClassError: + raise exc.UnmappedInstanceError(instance) + except exc.NO_STATE: raise exc.UnmappedInstanceError(instance) |