Skip Montanaro <[email protected]> added the comment:
This is to be expected. The Error Exception is actually defined in the
underlying _csv extension module. The higher level csv Python module
imports it. The two are the same object:
>>> import csv, _csv
>>> csv.Error
<class _csv.Error at 0x818517c>
>>> _csv.Error
<class _csv.Error at 0x818517c>
>>> csv.Error is _csv.Error
True
So, continue to use
try:
...
except csv.Error:
...
and ignore the leading underscore.
----------
nosy: +skip.montanaro
resolution: -> invalid
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue7711>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com