From 1e8838d4e44a366b2d4c162fdad2f9e3df18c0af Mon Sep 17 00:00:00 2001 From: Bas Couwenberg Date: Mon, 5 Nov 2018 13:28:37 +0100 Subject: [PATCH] Decode data instead of Python specific open calls. --- setup.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index cd5522e..7f9024c 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,11 @@ -import codecs -import sys - from setuptools import setup -PYTHON3 = sys.version_info[0] == 3 - def read_file(file): - if PYTHON3: - return open(file, encoding='utf-8').read() - else: - return codecs.open(file, encoding='utf-8').read() + with open(file, 'rb') as fh: + data = fh.read() + + return data.decode('utf-8') setup(name='pyshp', version='2.0.0',