From: Robert Collins Date: Sat, 25 Jul 2015 18:50:51 +0000 (+1200) Subject: Issue #24710: Use cls in TracebackException.from_exception. X-Git-Tag: v3.6.0a1~1906 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aece8248b6257cd8c0840963a794537b9e1d9d14;p=thirdparty%2FPython%2Fcpython.git Issue #24710: Use cls in TracebackException.from_exception. Minor cleanup patch from Berker Peksag. --- diff --git a/Lib/traceback.py b/Lib/traceback.py index 02edeb6217ee..3d2e5e0685c3 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."""