Commit ad7a21e8 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into staging



Python 3 compatibility fixes

# gpg: Signature made Fri 25 Jan 2019 14:04:56 GMT
# gpg:                using RSA key 2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/python-next-pull-request:
  decodetree: re.fullmatch was added in 3.4
  device-crash-test: Python 3 compatibility fix

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 2dc2f10d 651514df
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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):
+2 −1
Original line number Diff line number Diff line
@@ -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)