[PATCH 4 of 7 v2] tests: stop using old except syntax in test-bundle2-format

Augie Fackler raf at durin42.com
Tue Aug 22 17:27:55 EDT 2017


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1503428707 14400
#      Tue Aug 22 15:05:07 2017 -0400
# Node ID ccb38cfe8b6d7833490e9db28eda18968f27c490
# Parent  97dba357fcdb6caf5a0f9f5f074a69306a5a8950
tests: stop using old except syntax in test-bundle2-format

diff --git a/tests/test-bundle2-format.t b/tests/test-bundle2-format.t
--- a/tests/test-bundle2-format.t
+++ b/tests/test-bundle2-format.t
@@ -89,7 +89,7 @@ Create an extension to test bundle2 API
   >         p = p.split('=', 1)
   >         try:
   >             bundler.addparam(*p)
-  >         except ValueError, exc:
+  >         except ValueError as exc:
   >             raise error.Abort('%s' % exc)
   > 
   >     if opts['compress']:
@@ -164,7 +164,7 @@ Create an extension to test bundle2 API
   >     try:
   >         for chunk in bundler.getchunks():
   >             file.write(chunk)
-  >     except RuntimeError, exc:
+  >     except RuntimeError as exc:
   >         raise error.Abort(exc)
   >     finally:
   >         file.flush()
@@ -180,9 +180,9 @@ Create an extension to test bundle2 API
   >             unbundler = bundle2.getunbundler(ui, sys.stdin)
   >             op = bundle2.processbundle(repo, unbundler, lambda: tr)
   >             tr.close()
-  >         except error.BundleValueError, exc:
+  >         except error.BundleValueError as exc:
   >             raise error.Abort('missing support for %s' % exc)
-  >         except error.PushRaced, exc:
+  >         except error.PushRaced as exc:
   >             raise error.Abort('push race: %s' % exc)
   >     finally:
   >         if tr is not None:
@@ -206,7 +206,7 @@ Create an extension to test bundle2 API
   >     unbundler = bundle2.getunbundler(ui, sys.stdin)
   >     try:
   >         params = unbundler.params
-  >     except error.BundleValueError, exc:
+  >     except error.BundleValueError as exc:
   >        raise error.Abort('unknown parameters: %s' % exc)
   >     ui.write('options count: %i\n' % len(params))
   >     for key in sorted(params):


More information about the Mercurial-devel mailing list