Skip to content

Commit 6c5c83a

Browse files
committed
Py3 / Py2 compatibility
1 parent 6f2fb0b commit 6c5c83a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎tests/test_core.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
import tempfile
55
import warnings
66
import sh
7-
from io import BytesIO
7+
try:
8+
from StringIO import StringIO
9+
except ImportError:
10+
from io import StringIO
811

912
from dotenv import load_dotenv, find_dotenv, set_key
1013
from dotenv.main import parse_dotenv
@@ -115,7 +118,7 @@ def test_ipython_override():
115118

116119

117120
def test_parse_dotenv_stream():
118-
stream = BytesIO('DOTENV=WORKS\n')
121+
stream = StringIO('DOTENV=WORKS\n')
119122
stream.seek(0)
120123
parsed_generator = parse_dotenv(stream=stream)
121124
parsed_dict = dict(iter(parsed_generator))

0 commit comments

Comments
 (0)