Skip to content

Commit

Permalink
🚑 fix the assumed availability of mmap in google app engine, #45
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Dec 22, 2017
1 parent 3f1d14a commit a5e2572
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyexcel_io/readers/csvr.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def open_stream(self, file_stream, multiple_sheets=False, **keywords):
self._native_book = self._load_from_stream()

def open_content(self, file_content, **keywords):
if compact.PY27_ABOVE:
try:
import mmap
encoding = keywords.get('encoding', 'utf-8')
if isinstance(file_content, mmap.mmap):
Expand All @@ -247,7 +247,8 @@ def open_content(self, file_content, **keywords):
# else python 2.7 does not care about bytes nor str
BookReader.open_content(
self, file_content, **keywords)
else:
except ImportError:
# python 2.6 or Google app engine
BookReader.open_content(
self, file_content, **keywords)

Expand Down

0 comments on commit a5e2572

Please sign in to comment.