chore: Upgrade Python syntax with pyupgrade
Run with the following pre-commit configuration: ``` repos: - repo: https://github.com/asottile/pyupgrade rev: v3.1.0 hooks: - id: pyupgrade args: [ "--py3-plus", "--py36-plus", "--py37-plus" ] ``` The rationale for every change can be found at https://github.com/asottile/pyupgrade
This commit is contained in:
1 parent
92eab3c929
commit
bd4eb89b8c
29 files changed
+32
-65
No files matched your search
@@ -10,7 +10,7 @@ PROJECT_DIR = path.abspath(path.dirname(__file__))
|
||||
def get_version():
|
||||
constants = path.join(PROJECT_DIR, "django_migration_linter", "constants.py")
|
||||
_version_re = re.compile(r"__version__\s+=\s+(?P<version>.*)")
|
||||
with open(constants, "r") as f:
|
||||
with open(constants) as f:
|
||||
match = _version_re.search(f.read())
|
||||
version = match.group("version") if match is not None else '"unknown"'
|
||||
return str(ast.literal_eval(version))
|
||||
|
||||
Reference in new issue
Block a user