[pypy-dev] [pypy-commit] cffi default: Try to preserve the exact error message

Philip Jenvey pjenvey at underboss.org
Fri May 10 19:57:17 CEST 2013


Could you please switch this to Py3 compat syntax, KeyError as e?

On May 10, 2013, at 7:07 AM, arigo wrote:

> Author: Armin Rigo <arigo at tunes.org>
> Branch: 
> Changeset: r1250:452b57d57304
> Date: 2013-05-10 16:07 +0200
> http://bitbucket.org/cffi/cffi/changeset/452b57d57304/
> 
> Log:	Try to preserve the exact error message
> 
> diff --git a/cffi/api.py b/cffi/api.py
> --- a/cffi/api.py
> +++ b/cffi/api.py
> @@ -372,8 +372,8 @@
>             BType = ffi._get_cached_btype(tp)
>             try:
>                 value = backendlib.load_function(BType, name)
> -            except KeyError:
> -                raise AttributeError(name)
> +            except KeyError, e:
> +                raise AttributeError('%s: %s' % (name, e))
>             library.__dict__[name] = value
>             return
>         #
> _______________________________________________
> pypy-commit mailing list
> pypy-commit at python.org
> http://mail.python.org/mailman/listinfo/pypy-commit

--
Philip Jenvey



More information about the pypy-dev mailing list