From: Mike Bayer Date: Mon, 23 Apr 2012 22:53:58 +0000 (-0400) Subject: the callcounts are greater here since object_mapper() has a little more overhead... X-Git-Tag: rel_0_8_0b1~472 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=101da94e1282a410557784272bda58222ac048b4;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git the callcounts are greater here since object_mapper() has a little more overhead to it now --- 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()