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

Georg Brandl g.brandl at gmx.net
Fri Sep 18 15:55:14 CEST 2009


Benjamin Peterson schrieb:
> 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().

Ouch. Fixed in r74908.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-checkins mailing list