Browse Source

Merge "Switch use of cStringIO.StringIO to io.BytesIO"

Jenkins 3 years ago
parent
commit
630ba7fad2
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      files/subunit-gearman-worker.py

+ 4
- 4
files/subunit-gearman-worker.py View File

@@ -15,10 +15,10 @@
15 15
 # under the License.
16 16
 
17 17
 import argparse
18
-import cStringIO
19 18
 import daemon
20 19
 import gear
21 20
 import gzip
21
+import io
22 22
 import json
23 23
 import logging
24 24
 import os
@@ -121,14 +121,14 @@ class SubunitRetriever(threading.Thread):
121 121
             return None
122 122
         if gzipped:
123 123
             logging.debug("Decompressing gzipped source file.")
124
-            raw_strIO = cStringIO.StringIO(raw_buf)
124
+            raw_strIO = io.BytesIO(raw_buf)
125 125
             f = gzip.GzipFile(fileobj=raw_strIO)
126
-            buf = cStringIO.StringIO(f.read())
126
+            buf = io.BytesIO(f.read())
127 127
             raw_strIO.close()
128 128
             f.close()
129 129
         else:
130 130
             logging.debug("Decoding source file.")
131
-            buf = cStringIO.StringIO(raw_buf)
131
+            buf = io.BytesIO(raw_buf)
132 132
         return buf
133 133
 
134 134
     def _get_subunit_data(self, source_url, retry):

Loading…
Cancel
Save