Date: Mon, 20 May 2019 22:37:42 +0000 (UTC) From: Enji Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r348021 - user/ngie/bug-237403/tests/sys/opencrypto Message-ID: <201905202237.x4KMbgMd021398@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Mon May 20 22:37:42 2019 New Revision: 348021 URL: https://svnweb.freebsd.org/changeset/base/348021 Log: Don't raise StopIteration when complete; a bare return suffices Bare return statements are valid terminators for generators: https://docs.python.org/2/reference/simple_stmts.html#the-return-statement . Modified: user/ngie/bug-237403/tests/sys/opencrypto/cryptodev.py Modified: user/ngie/bug-237403/tests/sys/opencrypto/cryptodev.py ============================================================================== --- user/ngie/bug-237403/tests/sys/opencrypto/cryptodev.py Mon May 20 22:32:31 2019 (r348020) +++ user/ngie/bug-237403/tests/sys/opencrypto/cryptodev.py Mon May 20 22:37:42 2019 (r348021) @@ -356,7 +356,7 @@ class KATParser: didread = True if didread and not i: - raise StopIteration + return if not i.startswith('#') and i.strip(): break @@ -501,7 +501,7 @@ class KATCCMParser: else: line = self.fp.readline() if not line: - raise StopIteration + return if (line and line[0] == '#') or not line.strip(): continue
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905202237.x4KMbgMd021398>