mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
gh-114628: Display csv.Error without context (#115005)
When cvs.Error is raised when TypeError is caught, the TypeError display and 'During handling' note is just noise with duplicate information. Suppress with 'from None'.
This commit is contained in:
parent
391659b3da
commit
e207cc181f
2 changed files with 4 additions and 2 deletions
|
@ -113,8 +113,8 @@ class Dialect:
|
|||
try:
|
||||
_Dialect(self)
|
||||
except TypeError as e:
|
||||
# We do this for compatibility with py2.3
|
||||
raise Error(str(e))
|
||||
# Re-raise to get a traceback showing more user code.
|
||||
raise Error(str(e)) from None
|
||||
|
||||
class excel(Dialect):
|
||||
"""Describe the usual properties of Excel-generated CSV files."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue