diff mbox

[11/11] qtest.py: Avoid using mutable list as default argument

Message ID 20170720162815.19802-12-ldoktor@redhat.com
State New
Headers show

Commit Message

Lukáš Doktor July 20, 2017, 4:28 p.m. UTC
The list is a mutable object and is dangerous to use it. Recently the
QEMUMachine was adjusted to allow None as default, let's use it here as
well.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
---
 scripts/qtest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eduardo Habkost July 20, 2017, 6:44 p.m. UTC | #1
On Thu, Jul 20, 2017 at 06:28:15PM +0200, Lukáš Doktor wrote:
> The list is a mutable object and is dangerous to use it. Recently the
> QEMUMachine was adjusted to allow None as default, let's use it here as
> well.
> 
> Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>

This patch requires patch 02/11 and both are pretty small.
I suggest squashing them together.
Lukáš Doktor July 21, 2017, 6:58 a.m. UTC | #2
Dne 20.7.2017 v 20:44 Eduardo Habkost napsal(a):
> On Thu, Jul 20, 2017 at 06:28:15PM +0200, Lukáš Doktor wrote:
>> The list is a mutable object and is dangerous to use it. Recently the
>> QEMUMachine was adjusted to allow None as default, let's use it here as
>> well.
>>
>> Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
> 
> This patch requires patch 02/11 and both are pretty small.
> I suggest squashing them together.
> 

Sure, I'll change it in the v2.

Lukáš
diff mbox

Patch

diff --git a/scripts/qtest.py b/scripts/qtest.py
index e4b5788..ba3233c 100644
--- a/scripts/qtest.py
+++ b/scripts/qtest.py
@@ -76,7 +76,7 @@  class QEMUQtestProtocol(object):
 class QEMUQtestMachine(qemu.QEMUMachine):
     '''A QEMU VM'''
 
-    def __init__(self, binary, args=[], name=None, test_dir="/var/tmp",
+    def __init__(self, binary, args=None, name=None, test_dir="/var/tmp",
                  socket_scm_helper=None):
         if name is None:
             name = "qemu-%d" % os.getpid()