You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by ha...@apache.org on 2010/06/04 23:51:25 UTC

svn commit: r951587 - /avro/branches/branch-1.3/lang/py/src/avro/datafile.py

Author: hammer
Date: Fri Jun  4 21:51:25 2010
New Revision: 951587

URL: http://svn.apache.org/viewvc?rev=951587&view=rev
Log:
Merge r951585 from trunk to 1.3 branch.  Fixes: AVRO-526.


Modified:
    avro/branches/branch-1.3/lang/py/src/avro/datafile.py

Modified: avro/branches/branch-1.3/lang/py/src/avro/datafile.py
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.3/lang/py/src/avro/datafile.py?rev=951587&r1=951586&r2=951587&view=diff
==============================================================================
--- avro/branches/branch-1.3/lang/py/src/avro/datafile.py (original)
+++ avro/branches/branch-1.3/lang/py/src/avro/datafile.py Fri Jun  4 21:51:25 2010
@@ -18,7 +18,10 @@ Read/Write Avro File Object Containers.
 """
 import zlib
 import uuid
-import cStringIO
+try:
+  from cStringIO import StringIO
+except ImportError:
+  from StringIO import StringIO
 from avro import schema
 from avro import io
 
@@ -74,7 +77,7 @@ class DataFileWriter(object):
     self._writer = writer
     self._encoder = io.BinaryEncoder(writer)
     self._datum_writer = datum_writer
-    self._buffer_writer = cStringIO.StringIO()
+    self._buffer_writer = StringIO()
     self._buffer_encoder = io.BinaryEncoder(self._buffer_writer)
     self._block_count = 0
     self._meta = {}
@@ -285,7 +288,7 @@ class DataFileReader(object):
       # -15 is the log of the window size; negative indicates
       # "raw" (no zlib headers) decompression.  See zlib.h.
       uncompressed = zlib.decompress(data, -15)
-      self._datum_decoder = io.BinaryDecoder(cStringIO.StringIO(uncompressed))
+      self._datum_decoder = io.BinaryDecoder(StringIO(uncompressed))
 
   def _skip_sync(self):
     """