[Python-checkins] r43299 - python/trunk/Lib/traceback.py

Neal Norwitz nnorwitz at gmail.com
Sat Mar 25 02:51:05 CET 2006


How about a test case?

Is this just for strings?  If so, should you just for basestring?

n
--

On 3/24/06, phillip.eby <python-checkins at python.org> wrote:
> Author: phillip.eby
> Date: Fri Mar 24 23:10:54 2006
> New Revision: 43299
>
> Modified:
>    python/trunk/Lib/traceback.py
> Log:
> Revert r42719, because the isinstance() check wasn't redundant; formatting a
> string exception was causing a TypeError.
>
>
> Modified: python/trunk/Lib/traceback.py
> ==============================================================================
> --- python/trunk/Lib/traceback.py       (original)
> +++ python/trunk/Lib/traceback.py       Fri Mar 24 23:10:54 2006
> @@ -158,7 +158,7 @@
>      """
>      list = []
>      if (type(etype) == types.ClassType
> -        or issubclass(etype, Exception)):
> +        or (isinstance(etype, type) and issubclass(etype, Exception))):
>          stype = etype.__name__
>      else:
>          stype = etype
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>


More information about the Python-checkins mailing list