]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- correct this to rewrite a multiple profile line correctly
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 14 Nov 2014 16:06:43 +0000 (11:06 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 14 Nov 2014 16:06:43 +0000 (11:06 -0500)
lib/sqlalchemy/testing/profiling.py

index fcb888f861559de7fbd8ca852132df22c4540e25..6fc51ef32e8451f5758dc19314f3017a3126a946 100644 (file)
@@ -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()