From 101da94e1282a410557784272bda58222ac048b4 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 23 Apr 2012 18:53:58 -0400 Subject: [PATCH] the callcounts are greater here since object_mapper() has a little more overhead to it now --- lib/sqlalchemy/orm/util.py | 4 +--- test/aaa_profiling/test_orm.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index f4dfef3d5e..3cbe3f84af 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -663,9 +663,7 @@ def object_state(instance): """ try: return attributes.instance_state(instance) - except exc.UnmappedClassError: - raise exc.UnmappedInstanceError(instance) - except exc.NO_STATE: + except (exc.UnmappedClassError, exc.NO_STATE): raise exc.UnmappedInstanceError(instance) diff --git a/test/aaa_profiling/test_orm.py b/test/aaa_profiling/test_orm.py index e5e04eea8e..8d2c374107 100644 --- a/test/aaa_profiling/test_orm.py +++ b/test/aaa_profiling/test_orm.py @@ -70,7 +70,7 @@ class MergeTest(fixtures.MappedTest): # third call, merge object already present. almost no calls. @profiling.function_call_count(variance=0.05, - versions={'2.7':11, '2.6':11, '2.5':15, '3': 12}) + versions={'2.7':14, '2.6':14, '2.5':15, '3': 12}) def go(): return sess2.merge(p2, load=False) p3 = go() -- 2.47.3