Patchwork D2531: templatefilters: stop using str as a variable name

login
register
mail settings
Submitter phabricator
Date March 1, 2018, 11:34 p.m.
Message ID <differential-rev-PHID-DREV-uw5nmvra7ub257gtycut-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28623/
State Superseded
Headers show

Comments

phabricator - March 1, 2018, 11:34 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  str() is an inbuilt function.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/templatefilters.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py
--- a/mercurial/templatefilters.py
+++ b/mercurial/templatefilters.py
@@ -264,9 +264,9 @@ 
     return encoding.lower(text)
 
 @templatefilter('nonempty')
-def nonempty(str):
+def nonempty(text):
     """Any text. Returns '(none)' if the string is empty."""
-    return str or "(none)"
+    return text or "(none)"
 
 @templatefilter('obfuscate')
 def obfuscate(text):