Skip to content

Commit ed0619e

Browse files
norajsavon-noir
authored andcommitted
fix python 2 compat
fix #138
1 parent d6f484f commit ed0619e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# -*- coding: utf-8 -*-
22
from distutils.core import setup
3+
import sys
34

4-
with open("README.rst", encoding="utf-8") as rfile:
5-
long_description = rfile.read()
5+
if sys.version_info >= (3,0):
6+
with open("README.rst", encoding="utf-8") as rfile:
7+
long_description = rfile.read()
8+
else: # encoding not compatible with python2
9+
with open("README.rst") as rfile:
10+
long_description = rfile.read()
611

712
setup(
813
name="python-libnmap",

0 commit comments

Comments
 (0)