Skip to content

Commit 92b606d

Browse files
committed
fixed python 2 compatibility
1 parent 4291d93 commit 92b606d

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
.DS_Store
33
build
44
dist
5-
random_access_file_reader.egg-info
5+
random_access_file_reader.egg-info
6+
*.pyc
7+
venv/

randomAccessReader/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import csv
1313
from io import StringIO
14+
import six
1415

1516
# ==========
1617
# classes
@@ -71,7 +72,7 @@ def get_lines(self, line_number, amount=1):
7172
for x in range(amount):
7273
line_data = self._lines[line_number]
7374
f.seek(line_data['position'])
74-
lines.append(f.read(line_data['length']))
75+
lines.append(six.u(f.read(line_data['length'])))
7576
return lines
7677

7778

Binary file not shown.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
six==1.11.0

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Versions should comply with PEP440. For a discussion on single-sourcing
1616
# the version across setup.py and the project code, see
1717
# https://packaging.python.org/en/latest/single_source_version.html
18-
version='0.3.0',
18+
version='0.3.1',
1919

2020
description='A python random access file reader',
2121
long_description=long_description,
@@ -54,5 +54,5 @@
5454
# You can just specify the packages manually here if your project is
5555
# simple. Or you can use find_packages().
5656
packages=['randomAccessReader'],
57-
57+
install_requires=['six']
5858
)

0 commit comments

Comments
 (0)