svn commit: r348021 - user/ngie/bug-237403/tests/sys/opencrypto

Enji Cooper ngie at FreeBSD.org
Mon May 20 22:37:43 UTC 2019


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


More information about the svn-src-user mailing list