Skip to content

Commit d290165

Browse files
committed
py3 compat
1 parent 2c277d6 commit d290165

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
pillow
2+
six

torchvision/datasets/lsun.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from PIL import Image
33
import os
44
import os.path
5-
import StringIO
5+
import six
66
import string
77
import sys
88
if sys.version_info[0] == 2:
@@ -34,7 +34,7 @@ def __getitem__(self, index):
3434
with env.begin(write=False) as txn:
3535
imgbuf = txn.get(self.keys[index])
3636

37-
buf = StringIO.StringIO()
37+
buf = six.BytesIO()
3838
buf.write(imgbuf)
3939
buf.seek(0)
4040
img = Image.open(buf).convert('RGB')

0 commit comments

Comments
 (0)