[Python-checkins] r74901 - python/trunk/Lib/inspect.py

Benjamin Peterson benjamin at python.org
Fri Sep 18 13:38:20 CEST 2009


2009/9/18 georg.brandl <python-checkins at python.org>:
> Author: georg.brandl
> Date: Fri Sep 18 11:14:52 2009
> New Revision: 74901
>
> Log:
> #6905: use better exception messages in inspect when the argument is of the wrong type.
>
> Modified:
>   python/trunk/Lib/inspect.py
>
> Modified: python/trunk/Lib/inspect.py
> ==============================================================================
> --- python/trunk/Lib/inspect.py (original)
> +++ python/trunk/Lib/inspect.py Fri Sep 18 11:14:52 2009
> @@ -402,12 +402,12 @@
>     if ismodule(object):
>         if hasattr(object, '__file__'):
>             return object.__file__
> -        raise TypeError('arg is a built-in module')
> +        raise TypeError('%r is a built-in module' % object)

You should use a (object,) or .format().



-- 
Regards,
Benjamin


More information about the Python-checkins mailing list