Skip to content

Commit

Permalink
Fixed a Py2/3 incompatibility in setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lovesegfault committed Jan 26, 2019
1 parent 0603186 commit 419f59d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion beautysh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from .beautysh import Beautify

__version__ = '4.0'
__version__ = '4.1'
11 changes: 9 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Setup for beautysh - A bash beautifier for the masses."""
from setuptools import setup
import sys


def get_version(file_name='beautysh/__init__.py'):
Expand All @@ -9,8 +10,14 @@ def get_version(file_name='beautysh/__init__.py'):
if "__version__" in line:
return eval(line.split('=')[-1])

with open("README.md", "r", encoding='utf8') as fh:
DESCRIPTION = fh.read()

if sys.version_info[0] < 3:
with open("README.md", "r") as readme:
DESCRIPTION = readme.read().decode("UTF-8")
else:
with open("README.md", "r", encoding="UTF-8") as readme:
DESCRIPTION = readme.read()


setup(
name='beautysh',
Expand Down

0 comments on commit 419f59d

Please sign in to comment.