519
520
def increment_call_count(self, params):
520
521
# Increment the count in the WeakKeyDictionary
521
522
value = self.counts[params.medium]
527
532
# In case this callback is invoked for the same ref twice (by the
528
533
# weakref callback and by the atexit function), set the call count back
529
534
# to 0 so this item won't be reported twice.
535
542
for ref in list(self.counts.keys()):