Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3.3
Changeset: r75165:d04014eeb0f2
Date: 2014-12-30 16:33 +0100
http://bitbucket.org/pypy/pypy/changeset/d04014eeb0f2/

Log:    Avoid crash in OSError.__str__()

diff --git a/pypy/module/exceptions/interp_exceptions.py 
b/pypy/module/exceptions/interp_exceptions.py
--- a/pypy/module/exceptions/interp_exceptions.py
+++ b/pypy/module/exceptions/interp_exceptions.py
@@ -543,8 +543,10 @@
 
     def _init_error(self, space, args_w, w_errno, w_strerror, w_filename):
         W_BaseException.descr_init(self, space, args_w)
-        self.w_errno = w_errno
-        self.w_strerror = w_strerror
+        if w_errno:
+            self.w_errno = w_errno
+        if w_strerror:
+            self.w_strerror = w_strerror
 
         if not space.is_none(w_filename):
             if space.isinstance_w(
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to