File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## Version 0.7
4
+ * [ #51 ] ( https://github.com/landscapeio/pylint-django/issues/51 ) - Fixed compatibility with pylint 1.5 / astroid 1.4.1
5
+
3
6
## Version 0.6.1
4
7
* [ #43 ] ( https://github.com/landscapeio/pylint-django/issues/43 ) - Foreign key ID access (` somefk_id ` ) does not raise an 'attribute not found' warning
5
8
* [ #31 ] ( https://github.com/landscapeio/pylint-django/issues/31 ) - Support for custom model managers (thanks [ smirolo] ( https://github.com/smirolo ) )
Original file line number Diff line number Diff line change 1
1
from astroid import MANAGER , scoped_nodes , nodes , inference_tip
2
+ import sys
2
3
from pylint_django import utils
3
4
4
5
@@ -33,7 +34,11 @@ def apply_type_shim(cls, context=None):
33
34
elif cls .name == 'FloatField' :
34
35
base_nodes = scoped_nodes .builtin_lookup ('float' )
35
36
elif cls .name == 'DecimalField' :
36
- base_nodes = MANAGER .ast_from_module_name ('decimal' ).lookup ('Decimal' )
37
+ if sys .versioninfo >= (3 , 5 ):
38
+ # I dunno, I'm tired and this works :(
39
+ base_nodes = MANAGER .ast_from_module_name ('_decimal' ).lookup ('Decimal' )
40
+ else :
41
+ base_nodes = MANAGER .ast_from_module_name ('decimal' ).lookup ('Decimal' )
37
42
elif cls .name in ('SplitDateTimeField' , 'DateTimeField' ):
38
43
base_nodes = MANAGER .ast_from_module_name ('datetime' ).lookup ('datetime' )
39
44
elif cls .name == 'TimeField' :
You can’t perform that action at this time.
0 commit comments