D2171: ui: use named attributes on FrameInfo instance

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Mon Feb 12 21:48:31 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGffcc3b977e43: ui: use named attributes on FrameInfo instance (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2171?vs=5472&id=5594

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

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1620,11 +1620,15 @@
         else:
             curframe = inspect.currentframe()
             calframe = inspect.getouterframes(curframe, 2)
-            self.write_err('%s at: %s:%s (%s)\n'
-                           % ((msg,) + calframe[stacklevel][1:4]))
+            frameinfo = calframe[stacklevel]
+
+            self.write_err('%s at: %s:%s (%s)\n' % (
+                msg, frameinfo.filename, frameinfo.lineno,
+                frameinfo.function))
             self.log('develwarn', '%s at: %s:%s (%s)\n',
-                     msg, *calframe[stacklevel][1:4])
-            curframe = calframe = None  # avoid cycles
+                     msg, frameinfo.filename, frameinfo.lineno,
+                     frameinfo.function)
+            curframe = calframe = frameinfo = None  # avoid cycles
 
     def deprecwarn(self, msg, version, stacklevel=2):
         """issue a deprecation warning



To: indygreg, #hg-reviewers, pulkit, durin42
Cc: mercurial-devel


More information about the Mercurial-devel mailing list