From: W. Trevor King Date: Fri, 19 Oct 2012 13:05:17 +0000 (-0400) Subject: Update to `except ... as ...` syntax for Python 3. X-Git-Tag: 0.6~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1c4691fe18c0a52a20c06b5162a9a254784413f6;p=pycomedi.git Update to `except ... as ...` syntax for Python 3. --- 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