diff options
author | Waylan Limberg <waylan@gmail.com> | 2012-12-18 14:57:07 -0500 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2012-12-18 14:57:07 -0500 |
commit | d6a747570a053f15dc4951689b7820248f2cc25f (patch) | |
tree | 850b64deb85eb5b8d7d72a13fa945c95eb926f45 | |
parent | 9bcd7b8763627c64184b0bf147ec1830fde0a5dc (diff) | |
download | markdown-d6a747570a053f15dc4951689b7820248f2cc25f.tar.gz markdown-d6a747570a053f15dc4951689b7820248f2cc25f.tar.bz2 markdown-d6a747570a053f15dc4951689b7820248f2cc25f.zip |
Fixed #169. The new version stuff now works in python 2 & 3.
-rwxr-xr-x | setup.py | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -8,6 +8,7 @@ from distutils.command.build import build from distutils.core import Command from distutils.util import change_root, newer import codecs +import imp # Try to run 2to3 automaticaly when building in Python 3.x try: @@ -17,9 +18,17 @@ except ImportError: raise ImportError("build_py_2to3 is required to build in Python 3.x.") from distutils.command.build_py import build_py -# Get version & version_info without importing markdown -execfile(os.path.join(os.path.dirname(os.path.abspath(__file__)), - 'markdown/__version__.py')) +def get_version(): + " Get version & version_info without importing markdown.__init__ " + path = os.path.join(os.path.dirname(__file__), 'markdown') + fp, pathname, desc = imp.find_module('__version__', [path]) + try: + v = imp.load_module('__version__', fp, pathname, desc) + return v.version, v.version_info + finally: + fp.close() + +version, version_info = get_version() # Get development Status for classifiers dev_status_map = { |