[pypy-commit] pypy rpython-enverror: fix

bdkearns noreply at buildbot.pypy.org
Fri Sep 5 21:12:59 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: rpython-enverror
Changeset: r73325:1ff37a253216
Date: 2014-09-05 15:12 -0400
http://bitbucket.org/pypy/pypy/changeset/1ff37a253216/

Log:	fix

diff --git a/rpython/rtyper/rbuiltin.py b/rpython/rtyper/rbuiltin.py
--- a/rpython/rtyper/rbuiltin.py
+++ b/rpython/rtyper/rbuiltin.py
@@ -3,9 +3,10 @@
 from rpython.rlib import rarithmetic, objectmodel
 from rpython.rtyper import raddress, rptr, extregistry, rrange
 from rpython.rtyper.error import TyperError
-from rpython.rtyper.lltypesystem import lltype, llmemory, rclass
+from rpython.rtyper.lltypesystem import lltype, llmemory, rclass, rstr
 from rpython.rtyper.lltypesystem.rdict import rtype_r_dict
 from rpython.rtyper.rmodel import Repr
+from rpython.rtyper.rstr import AbstractStringRepr
 from rpython.tool.pairtype import pairtype
 
 
@@ -272,10 +273,11 @@
         v_errno = hop.inputarg(lltype.Signed, arg=1)
         r_self.setfield(v_self, 'errno', v_errno, hop.llops)
         if hop.nb_args >= 3:
-            v_strerror = hop.inputarg(hop.args_r[2], arg=2)
-        else:
-            v_strerror = None
-        r_self.setfield(v_self, 'strerror', v_strerror, hop.llops)
+            v_strerror = hop.inputarg(rstr.string_repr, arg=2)
+            r_self.setfield(v_self, 'strerror', v_strerror, hop.llops)
+            if hop.nb_args >= 4:
+                v_filename = hop.inputarg(rstr.string_repr, arg=3)
+                r_self.setfield(v_self, 'filename', v_filename, hop.llops)
 
 def rtype_WindowsError__init__(hop):
     hop.exception_cannot_occur()


More information about the pypy-commit mailing list