diff options
author | Robert Collins <rbtcollins@hp.com> | 2015-07-26 06:50:51 +1200 |
---|---|---|
committer | Robert Collins <rbtcollins@hp.com> | 2015-07-26 06:50:51 +1200 |
commit | aece8248b6257cd8c0840963a794537b9e1d9d14 (patch) | |
tree | 86201e57c9f02874681a3e8347cfb0e78481a0f1 /Lib/traceback.py | |
parent | c94a1dc4c9a5d23fdb21f6928dd737a59ef3dfb2 (diff) | |
download | cpython-git-aece8248b6257cd8c0840963a794537b9e1d9d14.tar.gz |
Issue #24710: Use cls in TracebackException.from_exception.
Minor cleanup patch from Berker Peksag.
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 02edeb6217..3d2e5e0685 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -477,10 +477,9 @@ class TracebackException: self._load_lines() @classmethod - def from_exception(self, exc, *args, **kwargs): + def from_exception(cls, exc, *args, **kwargs): """Create a TracebackException from an exception.""" - return TracebackException( - type(exc), exc, exc.__traceback__, *args, **kwargs) + return cls(type(exc), exc, exc.__traceback__, *args, **kwargs) def _load_lines(self): """Private API. force all lines in the stack to be loaded.""" |