Skip to content

Commit

Permalink
Explicitly decode source for py3.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Nov 15, 2013
1 parent e226aa5 commit 4b94b14
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
# along with pygal. If not, see <http://www.gnu.org/licenses/>.
import os
import re
import sys
from setuptools import setup, find_packages

ROOT = os.path.dirname(__file__)
with open(os.path.join(ROOT, 'pygal', '__init__.py')) as fd:

# Explicitly specify the encoding of pygal/__init__.py if we're on py3.
kwargs = {}
if sys.version_info[0] == 3:
kwargs['encoding'] = 'utf-8'

with open(os.path.join(ROOT, 'pygal', '__init__.py'), **kwargs) as fd:
__version__ = re.search("__version__ = '([^']+)'", fd.read()).group(1)

setup(
Expand Down

0 comments on commit 4b94b14

Please sign in to comment.