From 1c4691fe18c0a52a20c06b5162a9a254784413f6 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 19 Oct 2012 09:05:17 -0400 Subject: [PATCH] Update to `except ... as ...` syntax for Python 3. --- doc/demo/info.py | 4 ++-- pycomedi/_error.pyx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/demo/info.py b/doc/demo/info.py index f08ff12..e5c76e4 100755 --- a/doc/demo/info.py +++ b/doc/demo/info.py @@ -50,7 +50,7 @@ def display_max_generic_timed(subdevice): """Fastest supported single-channel command""" try: command = subdevice.get_cmd_generic_timed(chanlist_len=1) - except _PyComediError, e: + except _PyComediError as e: if e.function_name != 'comedi_get_cmd_generic_timed': raise print(' command fast 1chan: (not supported)') @@ -68,7 +68,7 @@ def display_max_generic_timed(subdevice): def display_command(subdevice): try: command = subdevice.get_cmd_src_mask() - except _PyComediError, e: + except _PyComediError as e: if e.function_name != 'comedi_get_cmd_src_mask': raise print(' command: (not supported)') diff --git a/pycomedi/_error.pyx b/pycomedi/_error.pyx index 1533257..6e8e9a8 100644 --- a/pycomedi/_error.pyx +++ b/pycomedi/_error.pyx @@ -38,7 +38,7 @@ def raise_error(function_name=None, ret=None, error_msg=None): PyComediError: myfn (some error): Success (-1) >>> try: ... raise_error(function_name='myfn', ret=-1) - ... except PyComediError, e: + ... except PyComediError as e: ... print(e.function_name) ... print(e.ret) myfn -- 2.26.2