Kaydet (Commit) aece8248 authored tarafından Robert Collins's avatar Robert Collins

Issue #24710: Use cls in TracebackException.from_exception.

Minor cleanup patch from Berker Peksag.
üst c94a1dc4
...@@ -477,10 +477,9 @@ class TracebackException: ...@@ -477,10 +477,9 @@ class TracebackException:
self._load_lines() self._load_lines()
@classmethod @classmethod
def from_exception(self, exc, *args, **kwargs): def from_exception(cls, exc, *args, **kwargs):
"""Create a TracebackException from an exception.""" """Create a TracebackException from an exception."""
return TracebackException( return cls(type(exc), exc, exc.__traceback__, *args, **kwargs)
type(exc), exc, exc.__traceback__, *args, **kwargs)
def _load_lines(self): def _load_lines(self):
"""Private API. force all lines in the stack to be loaded.""" """Private API. force all lines in the stack to be loaded."""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment