Patchwork [2,of,2] py3: replace str.format(x) with `str % x` in githelp

login
register
mail settings
Submitter Matt Harbison
Date May 24, 2018, 2:28 a.m.
Message ID <c3960c7e66fad7436f1a.1527128933@Envy>
Download mbox | patch
Permalink /patch/31826/
State Accepted
Headers show

Comments

Matt Harbison - May 24, 2018, 2:28 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1527128700 14400
#      Wed May 23 22:25:00 2018 -0400
# Node ID c3960c7e66fad7436f1a550ef1de693a635faa3a
# Parent  cfa93fbbe9b4ee98d66a7dc55cb0224c4cf03e9f
py3: replace str.format(x) with `str % x` in githelp

Patch

diff --git a/hgext/githelp.py b/hgext/githelp.py
--- a/hgext/githelp.py
+++ b/hgext/githelp.py
@@ -94,9 +94,9 @@  def parseoptions(ui, cmdoptions, args):
             try:
                 args.remove(flag)
             except Exception:
-                msg = _("unknown option '{0}' packed with other options")
-                hint = _("please try passing the option as its own flag: -{0}")
-                raise error.Abort(msg.format(ex.opt), hint=hint.format(ex.opt))
+                msg = _("unknown option '%s' packed with other options")
+                hint = _("please try passing the option as its own flag: -%s")
+                raise error.Abort(msg % ex.opt, hint=hint % ex.opt)
 
             ui.warn(_("ignoring unknown option %s\n") % flag)