Kaydet (Commit) 5de3a641 authored tarafından Alex Gaynor's avatar Alex Gaynor Kaydeden (comit) Donald Stufft

Simplify code in warnings modules (#1935)

Metaprogramming a list of attributes was excessive, and made the code less readable and slower.
üst 9f396b60
......@@ -397,9 +397,13 @@ class WarningMessage(object):
def __init__(self, message, category, filename, lineno, file=None,
line=None, source=None):
local_values = locals()
for attr in self._WARNING_DETAILS:
setattr(self, attr, local_values[attr])
self.message = message
self.category = category
self.filename = filename
self.lineno = lineno
self.file = file
self.line = line
self.source = source
self._category_name = category.__name__ if category else None
def __str__(self):
......
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