Patchwork [2,of,2,python-hglib] util: drop mutable default from popen()

login
register
mail settings
Submitter Yuya Nishihara
Date Oct. 18, 2016, 3:12 p.m.
Message ID <50ce9593ec69508946fc.1476803533@mimosa>
Download mbox | patch
Permalink /patch/17168/
State Accepted
Headers show

Comments

Yuya Nishihara - Oct. 18, 2016, 3:12 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1476803147 -32400
#      Wed Oct 19 00:05:47 2016 +0900
# Node ID 50ce9593ec69508946fc2f9fc88d79a6b9bcfc33
# Parent  1ec4c46d309dcaef7a9bab6415cacbc5caf72dfe
util: drop mutable default from popen()

It can be None because it is used only if not empty.
Matt Mackall - Nov. 4, 2016, 6:08 p.m.
On Wed, 2016-10-19 at 00:12 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1476803147 -32400
> #      Wed Oct 19 00:05:47 2016 +0900
> # Node ID 50ce9593ec69508946fc2f9fc88d79a6b9bcfc33
> # Parent  1ec4c46d309dcaef7a9bab6415cacbc5caf72dfe
> util: drop mutable default from popen()

These are queued, thanks.

-- 
Mathematics is the supreme nostalgia of our time.

Patch

diff --git a/hglib/util.py b/hglib/util.py
--- a/hglib/util.py
+++ b/hglib/util.py
@@ -206,7 +206,7 @@  if os.name == 'nt':
     startupinfo = subprocess.STARTUPINFO()
     startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
 
-def popen(args, env={}):
+def popen(args, env=None):
     environ = None
     if env:
         environ = dict(os.environ)