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

Yuya Nishihara yuya at tcha.org
Tue Oct 18 11:12:13 EDT 2016


# HG changeset patch
# User Yuya Nishihara <yuya at 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.

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)


More information about the Mercurial-devel mailing list