[Python-apps-commits] r6929 - in packages/pyrit/trunk/debian/patches (2 files)

chrisk-guest at users.alioth.debian.org chrisk-guest at users.alioth.debian.org
Fri Apr 15 18:49:22 UTC 2011


    Date: Friday, April 15, 2011 @ 18:49:14
  Author: chrisk-guest
Revision: 6929

Handle empty result in PerformanceCounter gracefully. Closes: #620991

Added:
  packages/pyrit/trunk/debian/patches/0014-performancecounter-handle-empty-result-gracefully.patch
Modified:
  packages/pyrit/trunk/debian/patches/series

Added: packages/pyrit/trunk/debian/patches/0014-performancecounter-handle-empty-result-gracefully.patch
===================================================================
--- packages/pyrit/trunk/debian/patches/0014-performancecounter-handle-empty-result-gracefully.patch	                        (rev 0)
+++ packages/pyrit/trunk/debian/patches/0014-performancecounter-handle-empty-result-gracefully.patch	2011-04-15 18:49:14 UTC (rev 6929)
@@ -0,0 +1,25 @@
+From: Christian Kastner <debian at kvr.at>
+Date: Wed, 13 Apr 2011 21:16:23 +0200
+Subject: PerformanceCounter: handle empty result gracefully
+
+Handle cases in which no result is produced (eg: because of a window timeout)
+gracefully.
+
+Bug: http://code.google.com/p/pyrit/issues/detail?id=293
+Origin: other, http://code.google.com/p/pyrit/issues/detail?id=293
+Forwarded: not-needed
+Last-Update: 2011-04-13
+
+Index: pyrit-0.4.0/cpyrit/util.py
+===================================================================
+--- pyrit-0.4.0.orig/cpyrit/util.py	2011-04-13 21:21:49.063998293 +0200
++++ pyrit-0.4.0/cpyrit/util.py	2011-04-13 21:22:20.419996889 +0200
+@@ -374,7 +374,7 @@
+ 
+     def __purge(self):
+         t = time.time()
+-        if t - self.datapoints[0][0] > self.window:
++        if len(self.datapoints) > 0 and t - self.datapoints[0][0] > self.window:
+             self.datapoints = filter(lambda x: (t - x[0]) < self.window, \
+                                                 self.datapoints)
+ 

Modified: packages/pyrit/trunk/debian/patches/series
===================================================================
--- packages/pyrit/trunk/debian/patches/series	2011-04-13 08:47:03 UTC (rev 6928)
+++ packages/pyrit/trunk/debian/patches/series	2011-04-15 18:49:14 UTC (rev 6929)
@@ -1 +1,2 @@
 0006-custom-config-file.patch
+0014-performancecounter-handle-empty-result-gracefully.patch




More information about the Python-apps-commits mailing list