diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index 7b8a20108b161dd313a57d33929e573f89c201c6..2e307a03ad8b4aa5fee44d21a94f3b87bbe125d7 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -163,11 +163,11 @@ def runUntilCurrentTimer(func):
 
         # _newTimedCalls is one long list of *all* pending calls. Below loop
         # is based off of impl of reactor.runUntilCurrent
-        for p in reactor._newTimedCalls:
-            if p.time > now:
+        for delayed_call in reactor._newTimedCalls:
+            if delayed_call.time > now:
                 break
 
-            if p.delayed_time > 0:
+            if delayed_call.delayed_time > 0:
                 continue
 
             num_pending += 1