Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 14:07:13 -0000
From:      Enji Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r346447 - user/ngie/bug-237403/tests/sys/opencrypto
Message-ID:  <201904201605.x3KG55Q2051303@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sat Apr 20 16:05:04 2019
New Revision: 346447
URL: https://svnweb.freebsd.org/changeset/base/346447

Log:
  Use py3 compatible method for catching exceptions
  
  Now ancient versions of python used to support catching exceptions in the form
  `except Exception, exception_object`. This support was removed in py3 (and
  introduced preemptively in earlier 2.x versions), being replaced by the form
  `except Exception as exception_object`.

Modified:
  user/ngie/bug-237403/tests/sys/opencrypto/cryptotest.py

Modified: user/ngie/bug-237403/tests/sys/opencrypto/cryptotest.py
==============================================================================
--- user/ngie/bug-237403/tests/sys/opencrypto/cryptotest.py	Sat Apr 20 16:01:04 2019	(r346446)
+++ user/ngie/bug-237403/tests/sys/opencrypto/cryptotest.py	Sat Apr 20 16:05:04 2019	(r346447)
@@ -113,7 +113,7 @@ def GenTestCase(cname):
                             cipherkey,
                             mac=self._gmacsizes[len(cipherkey)],
                             mackey=cipherkey, crid=crid)
-                    except EnvironmentError, e:
+                    except EnvironmentError as e:
                         # Can't test algorithms the driver does not support.
                         if e.errno != errno.EOPNOTSUPP:
                             raise
@@ -122,7 +122,7 @@ def GenTestCase(cname):
                     if mode == 'ENCRYPT':
                         try:
                             rct, rtag = c.encrypt(pt, iv, aad)
-                        except EnvironmentError, e:
+                        except EnvironmentError as e:
                             # Can't test inputs the driver does not support.
                             if e.errno != errno.EINVAL:
                                 raise
@@ -142,7 +142,7 @@ def GenTestCase(cname):
                         else:
                             try:
                                 rpt, rtag = c.decrypt(*args)
-                            except EnvironmentError, e:
+                            except EnvironmentError as e:
                                 # Can't test inputs the driver does not support.
                                 if e.errno != errno.EINVAL:
                                     raise
@@ -210,7 +210,7 @@ def GenTestCase(cname):
                     try:
                         c = Crypto(meth, cipherkey, crid=crid)
                         r = curfun(c, pt, iv)
-                    except EnvironmentError, e:
+                    except EnvironmentError as e:
                         # Can't test hashes the driver does not support.
                         if e.errno != errno.EOPNOTSUPP:
                             raise
@@ -309,7 +309,7 @@ def GenTestCase(cname):
                     try:
                         c = Crypto(mac=alg, mackey=key,
                             crid=crid)
-                    except EnvironmentError, e:
+                    except EnvironmentError as e:
                         # Can't test hashes the driver does not support.
                         if e.errno != errno.EOPNOTSUPP:
                             raise





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904201605.x3KG55Q2051303>