Introduce a first PY2/PY3 difference for inspect.get(full)argspec call
This commit is contained in:
1 parent
a0e7ca099b
commit
19023626e6
2 files changed
+6
No files matched your search
@@ -12,6 +12,7 @@ from django.core.management import call_command
|
|||||||
from django.db import DEFAULT_DB_ALIAS, connections, ProgrammingError
|
from django.db import DEFAULT_DB_ALIAS, connections, ProgrammingError
|
||||||
from django.db.migrations import RunPython
|
from django.db.migrations import RunPython
|
||||||
from enum import Enum, unique
|
from enum import Enum, unique
|
||||||
|
from six import PY2
|
||||||
|
|
||||||
from .cache import Cache
|
from .cache import Cache
|
||||||
from .constants import (
|
from .constants import (
|
||||||
@@ -402,7 +403,11 @@ class MigrationLinter(object):
|
|||||||
else:
|
else:
|
||||||
warning.append(issue)
|
warning.append(issue)
|
||||||
|
|
||||||
|
if PY2:
|
||||||
|
args_spec = inspect.getargspec(runpython.code)
|
||||||
|
else:
|
||||||
args_spec = inspect.getfullargspec(runpython.code)
|
args_spec = inspect.getfullargspec(runpython.code)
|
||||||
|
|
||||||
if tuple(args_spec.args) != EXPECTED_DATA_MIGRATION_ARGS:
|
if tuple(args_spec.args) != EXPECTED_DATA_MIGRATION_ARGS:
|
||||||
issue = {
|
issue = {
|
||||||
"code": "NAMING_CONVENTION_RUNPYTHON_ARGS",
|
"code": "NAMING_CONVENTION_RUNPYTHON_ARGS",
|
||||||
|
|||||||
Reference in new issue
Block a user