def get_version():
"""Get version and version_info without importing the entire module."""
devstatus = {
'alpha': '3 - Alpha',
'beta': '4 - Beta',
'candidate': '4 - Beta',
'final': '5 - Production/Stable'
}
path = os.path.join(os.path.dirname(__file__), 'backrefs')
fp, pathname, desc = imp.find_module('__init__', [path])
try:
v = imp.load_module('__init__', fp, pathname, desc)
return v.version, devstatus[v.version_info[3]]
except Exception:
print(traceback.format_exc())
finally:
fp.close()
评论列表
文章目录