Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

update

  • Loading branch information...
commit d2c1d66feccb8dd29deb56c6b663b89818d3dd51 1 parent 36e5abf
Maarten van Gompel authored April 05, 2013

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  statistics.py
5  statistics.py
@@ -118,7 +118,10 @@ def items(self):
118 118
 
119 119
     def __getitem__(self, type):
120 120
         if self.dovalidation: type = self._validate(type)
121  
-        return self._count[type]
  121
+        try:
  122
+            return self._count[type]
  123
+        except KeyError:
  124
+            return 0
122 125
 
123 126
     def __setitem__(self, type, value):
124 127
         """alias for count, but can only be called once"""

0 notes on commit d2c1d66

Please sign in to comment.
Something went wrong with that request. Please try again.