Author: Alex Gaynor <alex.gay...@gmail.com>
Branch: 
Changeset: r91512:71f3e458447f
Date: 2017-06-04 15:45 -0400
http://bitbucket.org/pypy/pypy/changeset/71f3e458447f/

Log:    Backport 5de3a64179bafcd440b32849b1129ed1fea47b85 from CPython.

        This will speed up usage of the warning module considerably

diff --git a/lib-python/2.7/warnings.py b/lib-python/2.7/warnings.py
--- a/lib-python/2.7/warnings.py
+++ b/lib-python/2.7/warnings.py
@@ -309,9 +309,12 @@
 
     def __init__(self, message, category, filename, lineno, file=None,
                     line=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._category_name = category.__name__ if category else None
 
     def __str__(self):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to