Introduce a first PY2/PY3 difference for inspect.get(full)argspec call

This commit is contained in:
David Wobrock committed 2020-02-07 23:29:15 +01:00
1 parent a0e7ca099b
commit 19023626e6
2 files changed
+7 -1

No files matched your search

+6 -1
View File
@@ -12,6 +12,7 @@ from django.core.management import call_command
from django.db import DEFAULT_DB_ALIAS, connections, ProgrammingError
from django.db.migrations import RunPython
from enum import Enum, unique
from six import PY2
from .cache import Cache
from .constants import (
@@ -402,7 +403,11 @@ class MigrationLinter(object):
else:
warning.append(issue)
args_spec = inspect.getfullargspec(runpython.code)
if PY2:
args_spec = inspect.getargspec(runpython.code)
else:
args_spec = inspect.getfullargspec(runpython.code)
if tuple(args_spec.args) != EXPECTED_DATA_MIGRATION_ARGS:
issue = {
"code": "NAMING_CONVENTION_RUNPYTHON_ARGS",
+1
View File
@@ -35,6 +35,7 @@ setup(
"django>=1.11",
"appdirs==1.4.3",
'enum34==1.1.6;python_version<"3.4"',
"six==1.14.0",
],
extras_require={
"test": [