Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e8838d

Browse files
sebastickarimbahgat
authored andcommitted
Decode data instead of Python specific open calls.
1 parent e1983dc commit 1e8838d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

setup.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
import codecs
2-
import sys
3-
41
from setuptools import setup
52

63

7-
PYTHON3 = sys.version_info[0] == 3
8-
94
def read_file(file):
10-
if PYTHON3:
11-
return open(file, encoding='utf-8').read()
12-
else:
13-
return codecs.open(file, encoding='utf-8').read()
5+
with open(file, 'rb') as fh:
6+
data = fh.read()
7+
8+
return data.decode('utf-8')
149

1510
setup(name='pyshp',
1611
version='2.0.0',

0 commit comments

Comments
 (0)