Skip to contentSkip to conversation

Python 3 compatibility fixes

GIT PULL Applied Eduardo Habkost 2 participants 4 messages Jan 25, 2019

lore
Share & tools
lore
#0 lore raw

The following changes since commit 9dd0d8111fbb8015db75a38933aee1d45f9e64a3:

Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2019-01-24' into staging (2019-01-25 11:52:12 +0000)

are available in the Git repository at:

git://github.com/ehabkost/qemu.git tags/python-next-pull-request

for you to fetch changes up to 651514df88fd53d537b3b78a7548663cc0816b1b:

decodetree: re.fullmatch was added in 3.4 (2019-01-25 11:41:42 -0200)

----------------------------------------------------------------
Python 3 compatibility fixes

----------------------------------------------------------------

Nisarg Shah (1):
device-crash-test: Python 3 compatibility fix

Paolo Bonzini (1):
decodetree: re.fullmatch was added in 3.4

 scripts/decodetree.py     | 2 +-
 scripts/device-crash-test | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
#1 lore raw

[Qemu-devel] [PULL 2/2] decodetree: re.fullmatch was added in 3.4

From: Paolo Bonzini <[email protected]>

Python 3 versions earlier than 3.4 do not have it, use the same workaround that is in place for 3.0.

Message-Id: <[email protected]>

---
 scripts/decodetree.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/decodetree.py +1 -1
index 0bc73b5990..e342d278b8 100755
@@ -204,7 +204,7 @@ def output(*args):
         output_fd.write(a)
 
 
-if sys.version_info >= (3, 0):
+if sys.version_info >= (3, 4):
     re_fullmatch = re.fullmatch
 else:
     def re_fullmatch(pat, str):
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
#2 lore raw

[Qemu-devel] [PULL 1/2] device-crash-test: Python 3 compatibility fix

In reply to Eduardo Habkost

From: Nisarg Shah <[email protected]>

Restrict whitelist entry stats in debug mode to be sorted only by "count", since Python 3 does not implicitly support comparing dictionaries.

Message-Id: <[email protected]>

[ehabkost: removed 2 unnecessary hunks from patch]
[ehabkost: edited commit message]
---
 scripts/device-crash-test | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/device-crash-test +2 -1
index 483dafb2fc..2a13fa4f84 100755
@@ -557,7 +557,8 @@ def main():
         logger.info("Skipped %d test cases", skipped)
 
     if args.debug:
-        stats = sorted([(len(wl_stats.get(i, [])), wl) for i, wl in enumerate(ERROR_WHITELIST)])
+        stats = sorted([(len(wl_stats.get(i, [])), wl) for i, wl in
+                         enumerate(ERROR_WHITELIST)], key=lambda x: x[0])
         for count, wl in stats:
             dbg("whitelist entry stats: %d: %r", count, wl)
 
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
#3 lore raw
In reply to Eduardo Habkost
Quoted 9 lines · Eduardo Habkost

The following changes since commit 9dd0d8111fbb8015db75a38933aee1d45f9e64a3:

Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2019-01-24' into staging (2019-01-25 11:52:12 +0000)

are available in the Git repository at:

git://github.com/ehabkost/qemu.git tags/python-next-pull-request

Quoted 8 lines

for you to fetch changes up to 651514df88fd53d537b3b78a7548663cc0816b1b:

decodetree: re.fullmatch was added in 3.4 (2019-01-25 11:41:42 -0200)

----------------------------------------------------------------
Python 3 compatibility fixes

----------------------------------------------------------------

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.

-- PMM