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