[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH] device-crash-test: Convert to Py

From: Nisarg Shah
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] device-crash-test: Convert to Python 3
Date: Wed, 30 Jan 2019 23:30:10 +0530
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

Thanks for the review.

On 1/24/19 12:20 AM, Eduardo Habkost wrote:

This breaks Python 2 support:

$ python2 scripts/device-crash-test
   File "scripts/device-crash-test", line 534
     print("No QEMU binary found", file=sys.stderr)
SyntaxError: invalid syntax

Apologies. This is my first patch to qemu and I did not consider backward compatibility with Python 2. I'll see if I can fix this.
import sys
  import os
@@ -272,7 +272,7 @@ def qemuOptsEscape(s):
def formatTestCase(t):
      """Format test case info as "key=value key=value" for prettier logging 
-    return ' '.join('%s=%s' % (k, v) for k, v in t.items())
+    return ' '.join('%s=%s' % (k, v) for k, v in list(t.items()))

Why is this necessary?

This was automatically modified by the 2to3 tool. I see that it is not really required.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]