Patchwork [04,of,10] py3: convert key to str to make kwargs.pop work

login
register
mail settings
Submitter Pulkit Goyal
Date May 6, 2017, 3:01 a.m.
Message ID <cfc021a731d59f713ffa.1494039676@pulkit-goyal>
Download mbox | patch
Permalink /patch/20472/
State Accepted
Headers show

Comments

Pulkit Goyal - May 6, 2017, 3:01 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1493939922 -19800
#      Fri May 05 04:48:42 2017 +0530
# Node ID cfc021a731d59f713ffa1c54eb855d680125168b
# Parent  6b6133f042eff0ca52612a58e8b071dffdfb7347
py3: convert key to str to make kwargs.pop work

The keys are passed here and there as unicodes and our transformer make things
bytes. Due to that, mq was not poped and this results in error on Py3.
Here we abuse r'' to make that str on Python 3.

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -3540,7 +3540,7 @@ 
     """Add --mq option to operate on patch repository instead of main"""
 
     # some commands do not like getting unknown options
-    mq = kwargs.pop('mq', None)
+    mq = kwargs.pop(r'mq', None)
 
     if not mq:
         return orig(ui, repo, *args, **kwargs)