mercurial/progress.py
changeset 38423 6bd9f18d31a8
parent 36453 2831d918e1b4
child 38424 b34d0a6ef936
--- a/mercurial/progress.py	Tue Jun 19 18:21:37 2018 +0200
+++ b/mercurial/progress.py	Tue Jun 19 22:06:28 2018 -0700
@@ -265,8 +265,7 @@
 
     def progress(self, topic, pos, item='', unit='', total=None):
         now = time.time()
-        self._refreshlock.acquire()
-        try:
+        with self._refreshlock:
             if pos is None:
                 self.starttimes.pop(topic, None)
                 self.startvals.pop(topic, None)
@@ -298,5 +297,3 @@
                     if self._oktoprint(now):
                         self.lastprint = now
                         self.show(now, topic, *self.topicstates[topic])
-        finally:
-            self._refreshlock.release()