Patchwork D7759: ui: delete local variables instead of setting to `None`

login
register
mail settings
Submitter phabricator
Date Dec. 28, 2019, 1:29 a.m.
Message ID <differential-rev-PHID-DREV-kx6fc7n7pfgdbaujpe4l-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44103/
State Superseded
Headers show

Comments

phabricator - Dec. 28, 2019, 1:29 a.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The previous code was flagged by PyCharm as an unused variable assignment.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7759

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -2032,7 +2032,10 @@ 
             self.log(
                 b'develwarn', b'%s at: %s:%d (%s)\n', msg, fname, lineno, fmsg
             )
-            curframe = calframe = None  # avoid cycles
+
+            # avoid cycles
+            del curframe
+            del calframe
 
     def deprecwarn(self, msg, version, stacklevel=2):
         """issue a deprecation warning