Skip to content

Commit 2654bfd

Browse files
author
Davies Liu
committed
fix tests in python3
1 parent aa39c55 commit 2654bfd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

python/pyspark/shuffle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def load(f):
513513
chunks.append(load(open(path, 'rb')))
514514
current_chunk = []
515515
gc.collect()
516-
batch /= 2
516+
batch //= 2
517517
limit = self._next_limit()
518518
MemoryBytesSpilled += (used_memory - get_used_memory()) << 20
519519
DiskBytesSpilled += os.path.getsize(path)

python/pyspark/tests.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@
3131
import time
3232
import zipfile
3333
import random
34-
import itertools
3534
import threading
3635
import hashlib
37-
from StringIO import StringIO
3836

3937
from py4j.protocol import Py4JJavaError
4038

@@ -50,6 +48,11 @@
5048
xrange = range
5149
basestring = str
5250

51+
if sys.version >= "3":
52+
from io import StringIO
53+
else:
54+
from StringIO import StringIO
55+
5356

5457
from pyspark.conf import SparkConf
5558
from pyspark.context import SparkContext

0 commit comments

Comments
 (0)