Update to `except ... as ...` syntax for Python 3.
authorW. Trevor King <wking@tremily.us>
Fri, 19 Oct 2012 13:05:17 +0000 (09:05 -0400)
committerW. Trevor King <wking@tremily.us>
Fri, 19 Oct 2012 13:05:17 +0000 (09:05 -0400)
doc/demo/info.py
pycomedi/_error.pyx

index f08ff125685763397d40ded1630207993e259ea4..e5c76e4452fb0079267b73eccac65238736c49b6 100755 (executable)
@@ -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)')
index 15332573e3db5b846be128456c5a6a16eecc0f65..6e8e9a801e038ff98162a5a1a39efa3492516b89 100644 (file)
@@ -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