ErrorString is not an Exception
alda519 opened this issue · comments
you cannot except ErrorString like this:
Line 188 in 49f9a3f
because ErrorString is not an Exception, it is a function
>>> from xml.parsers.expat import ErrorString
>>> type(ErrorString)
<class 'builtin_function_or_method'>
>>> try:
... raise Exception()
... except ErrorString:
... pass
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
Exception
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
TypeError: catching classes that do not inherit from BaseException is not allowed
>>> ErrorString(1)
'out of memory'