-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refs #201] Adding compat layer back in, and fixing compatability bet…
…ween astroid 2.04 and 2.1wq
- Loading branch information
carlio
committed
Nov 26, 2018
1 parent
2ef6132
commit c0408d7
Showing
2 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
try: | ||
from astroid.nodes import ClassDef, FunctionDef, ImportFrom, AssignName, Attribute | ||
except ImportError: | ||
from astroid.nodes import ( | ||
Class as ClassDef, | ||
Function as FunctionDef, | ||
From as ImportFrom, | ||
AssName as AssignName, | ||
Getattr as Attribute, | ||
) | ||
|
||
try: | ||
from astroid.bases import YES as Uninferable | ||
except ImportError: | ||
try: | ||
from astroid.util import YES as Uninferable | ||
except ImportError: | ||
from astroid.util import Uninferable | ||
|
||
try: | ||
django = __import__("django") | ||
django_version = django.VERSION | ||
except ImportError: | ||
# if not available, will be handled by the django_installed checker | ||
django_version = (1, 5) | ||
|
||
|
||
def inferred(node): | ||
if hasattr(node, "inferred"): | ||
return node.inferred | ||
else: | ||
return node.infered | ||
|
||
|
||
def instantiate_class(node): | ||
if hasattr(node, "instantiate_class"): | ||
return node.instantiate_class | ||
else: | ||
return node.instanciate_class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters