Pychecker warns about Exception example from Python tutorial

Pekka Niiranen pekka.niiranen at wlanmail.com
Fri Oct 15 19:55:29 CEST 2004


Hi there,

why does pychecker v0.8.14 gives this warning:

koe2.py:2: Base class (exceptions.Exception) __init__() not called

when run against this example from Python Tutorial:

------------- code starts -------
class MyError(Exception):
     def __init__(self, value):
         self.value = value
     def __str__(self):
         return repr(self.value)

try:
     raise MyError(2*2)
except MyError, e:
     print 'My exception occurred, value:', e.value

------------- code starts -------

What does this warning mean and how can I disable it?

-pekka-



More information about the Python-list mailing list