Skip to content

Commit

Permalink
for py3 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
mythmgn committed Dec 10, 2019
1 parent 7ca74cd commit 4075c92
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import re
import sys
import platform
import textwrap
import traceback
import setuptools
Expand All @@ -24,8 +25,13 @@
print(traceback.print_exc())
exit(-1)

with open('README.md', 'r', encoding='utf-8') as fh:
LONG_DESCRIPTION = fh.read()
LONG_DESCRIPTION = None
if platform.python_version() < str(3):
with open('README.md', 'r') as fh:
LONG_DESCRIPTION = fh.read()
else:
with open('README.md', 'r', encoding='utf-8') as fh:
LONG_DESCRIPTION = fh.read()

# Guannan add windows platform support on 2014/11/4 20:04
def _find_packages(prefix=''):
Expand All @@ -34,6 +40,8 @@ def _find_packages(prefix=''):
path = '.'
prefix = prefix
for root, _, files in os.walk(path):
if root.find('examples') >= 0:
continue
if '__init__.py' in files:
item = None
if sys.platform.startswith('linux'):
Expand Down

0 comments on commit 4075c92

Please sign in to comment.