the import is not needed - bad PyCharm!

This commit is contained in:
Andy Grabow 2018-04-13 23:50:45 +02:00
parent be57e57077
commit eac95ec38a

View file

@ -1,17 +1,17 @@
#!/usr/bin/env python
import re
from builtins import RuntimeError
import os
from setuptools import setup
def get_version(*file_paths):
filename = os.path.join(os.path.dirname(__file__), *file_paths)
version_file = open(filename).read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError('Unable to find version string.')
raise RuntimeError('Please assure that the package version is defined as "__version__ = x.x.x" in ' + filename)
version = get_version("wagtail_modeltranslation", "__init__.py")