Patchwork D2171: ui: use named attributes on FrameInfo instance

login
register
mail settings
Submitter phabricator
Date Feb. 13, 2018, 2:48 a.m.
Message ID <b70ea80bb4f3a2243b2d06647581f630@localhost.localdomain>
Download mbox | patch
Permalink /patch/27775/
State Not Applicable
Headers show

Comments

phabricator - Feb. 13, 2018, 2:48 a.m.
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




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

Patch

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