[asterisk-dev] [Code Review] 3287: testsuite: improve yaml exception handling
Matt Jordan
reviewboard at asterisk.org
Tue Mar 4 16:44:49 CST 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3287/#review11055
-----------------------------------------------------------
/asterisk/trunk/lib/python/asterisk/test_config.py
<https://reviewboard.asterisk.org/r/3287/#comment20703>
Pedantic: except yaml.YAMLError, e is the old syntax for assigning the exception to e. The new syntax would be:
except yaml.YAMLError as e:
From http://docs.python.org/2/tutorial/errors.html:
"Note that the parentheses around this tuple are required, because except ValueError, e: was the syntax used for what is normally written as except ValueError as e: in modern Python (described below). The old syntax is still supported for backwards compatibility. This means except RuntimeError, TypeError is not equivalent to except (RuntimeError, TypeError): but to except RuntimeError as TypeError: which is not what you want."
- Matt Jordan
On March 4, 2014, 1:40 p.m., Scott Griepentrog wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3287/
> -----------------------------------------------------------
>
> (Updated March 4, 2014, 1:40 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: testsuite
>
>
> Description
> -------
>
> This patch adds improved
>
> Changes:
>
> Exception occurred while parsing config: <class 'yaml.parser.ParserError'>
>
> To:
>
> YAML error: while parsing a block mapping
> in "tests/rest_api/recording/basic/test-config.yaml", line 2, column 1
> expected <block end>, but found '<block sequence start>'
> in "tests/rest_api/recording/basic/test-config.yaml", line 71, column 9
>
>
> Diffs
> -----
>
> /asterisk/trunk/lib/python/asterisk/test_config.py 4765
>
> Diff: https://reviewboard.asterisk.org/r/3287/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Scott Griepentrog
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140304/dc9ac501/attachment.html>
More information about the asterisk-dev
mailing list