Skip to content

Commit a337ec0

Browse files
committed
Merge branch 'master' into develop
2 parents d84debe + 38a9bc6 commit a337ec0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

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+
36
## Version 0.6.1
47
* [#43](https://github.com/landscapeio/pylint-django/issues/43) - Foreign key ID access (`somefk_id`) does not raise an 'attribute not found' warning
58
* [#31](https://github.com/landscapeio/pylint-django/issues/31) - Support for custom model managers (thanks [smirolo](https://github.com/smirolo))

pylint_django/transforms/fields.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from astroid import MANAGER, scoped_nodes, nodes, inference_tip
2+
import sys
23
from pylint_django import utils
34

45

@@ -33,7 +34,11 @@ def apply_type_shim(cls, context=None):
3334
elif cls.name == 'FloatField':
3435
base_nodes = scoped_nodes.builtin_lookup('float')
3536
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')
3742
elif cls.name in ('SplitDateTimeField', 'DateTimeField'):
3843
base_nodes = MANAGER.ast_from_module_name('datetime').lookup('datetime')
3944
elif cls.name == 'TimeField':

0 commit comments

Comments
 (0)