From: Mike Bayer Date: Fri, 14 Nov 2014 16:06:43 +0000 (-0500) Subject: - correct this to rewrite a multiple profile line correctly X-Git-Tag: rel_1_0_0~19^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de9103aae22ba548323a3e469624f02d1d279103;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - correct this to rewrite a multiple profile line correctly --- diff --git a/lib/sqlalchemy/testing/profiling.py b/lib/sqlalchemy/testing/profiling.py index fcb888f861..6fc51ef32e 100644 --- a/lib/sqlalchemy/testing/profiling.py +++ b/lib/sqlalchemy/testing/profiling.py @@ -115,7 +115,11 @@ class ProfileStatsFile(object): per_fn = self.data[test_key] per_platform = per_fn[self.platform_key] counts = per_platform['counts'] - counts[-1] = callcount + current_count = per_platform['current_count'] + if current_count < len(counts): + counts[current_count - 1] = callcount + else: + counts[-1] = callcount if self.write: self._write()