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

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


Pulkit Goyal - May 6, 2017, 3:01 a.m.
# HG changeset patch
# User Pulkit Goyal <>
# 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.


diff --git a/hgext/ b/hgext/
--- a/hgext/
+++ b/hgext/
@@ -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)