[pypy-svn] pypy default: (alex, armin) fixed translation

alex_gaynor commits-noreply at bitbucket.org
Sat Mar 5 22:32:42 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r42429:a30ac9cb208f
Date: 2011-03-05 13:32 -0800
http://bitbucket.org/pypy/pypy/changeset/a30ac9cb208f/

Log:	(alex, armin) fixed translation

diff --git a/pypy/module/_file/interp_file.py b/pypy/module/_file/interp_file.py
--- a/pypy/module/_file/interp_file.py
+++ b/pypy/module/_file/interp_file.py
@@ -237,6 +237,9 @@
         if not self.binary and space.isinstance_w(w_data, space.w_unicode):
             w_data = space.call_method(w_data, "encode", space.wrap(self.encoding), space.wrap(self.errors))
         data = space.bufferstr_w(w_data)
+        self.do_direct_write(data)
+
+    def do_direct_write(self, data):
         self.softspace = 0
         self.getstream().write(data)
 
@@ -324,7 +327,7 @@
         '''fileno() -> integer "file descriptor".
 
 This is needed for lower-level file interfaces, such os.read().''')
-    
+
     _decl(locals(), "flush",
         """flush() -> None.  Flush the internal I/O buffer.""")
 
@@ -409,7 +412,7 @@
             return '?'
         elif self.space.is_true(self.space.isinstance(w_name,
                                                       self.space.w_str)):
-            return "'%s'" % self.space.str_w(w_name) 
+            return "'%s'" % self.space.str_w(w_name)
         else:
             return self.space.str_w(self.space.repr(w_name))
 

diff --git a/pypy/module/marshal/interp_marshal.py b/pypy/module/marshal/interp_marshal.py
--- a/pypy/module/marshal/interp_marshal.py
+++ b/pypy/module/marshal/interp_marshal.py
@@ -123,7 +123,7 @@
 
 class DirectStreamWriter(StreamReaderWriter):
     def write(self, data):
-        self.file.direct_write(data)
+        self.file.do_direct_write(data)
 
 class DirectStreamReader(StreamReaderWriter):
     def read(self, n):
@@ -449,7 +449,7 @@
         res_w = [None] * lng
         idx = 0
         space = self.space
-        w_ret = space.w_None # something not 
+        w_ret = space.w_None # something not
         while idx < lng:
             tc = self.get1()
             w_ret = self._dispatch[ord(tc)](space, self, tc)


More information about the Pypy-commit mailing list