Skip to content

Commit

Permalink
Merge pull request chrisdev#12 from nunchaks/master
Browse files Browse the repository at this point in the history
fix exception for python 3
  • Loading branch information
chrisdev authored Feb 2, 2017
2 parents cc74995 + c9217dd commit 1d216a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion flatpages_x/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def load_path_attr(path):
module, attr = path[:i], path[i + 1:]
try:
mod = import_module(module)
except ImportError, e:
except (ImportError, e):
raise ImproperlyConfigured("Error importing %s: '%s'" % (module, e))
try:
attr = getattr(mod, attr)
Expand Down
17 changes: 12 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import codecs
import os

from setuptools import setup, find_packages


def read(fname):
return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
def long_desc(root_path):
FILES = ['README.rst', ]
for filename in FILES:
filepath = os.path.realpath(os.path.join(root_path, filename))
if os.path.isfile(filepath):
with open(filepath, mode='r') as f:
yield f.read()


HERE = os.path.abspath(os.path.dirname(__file__))
long_description = "\n\n".join(long_desc(HERE))


PACKAGE = "flatpages_x"
Expand All @@ -16,12 +24,11 @@ def read(fname):
URL = "http://github.com/chrisdev/django-flatpages-x"
VERSION = __import__(PACKAGE).__version__


setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=read("README.rst"),
long_description=long_description,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
license="MIT",
Expand Down

0 comments on commit 1d216a2

Please sign in to comment.