diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-08-25 19:00:42 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-08-25 19:00:42 +0300 |
commit | 8ee4f7f329321bbf65712f365c7dbaa16ff9d2ef (patch) | |
tree | 7c40943e6e7b934da2062a57d7cbdd9cad5ef291 | |
parent | 64b3c326b012ad1237a1ffa174ba4c8f770775b9 (diff) | |
download | astroid-git-8ee4f7f329321bbf65712f365c7dbaa16ff9d2ef.tar.gz |
Use a stack level of 2 when emitting warnings, since the call site of the deprecated method should be warned upon.
-rw-r--r-- | astroid/bases.py | 2 | ||||
-rw-r--r-- | astroid/mixins.py | 6 | ||||
-rw-r--r-- | astroid/node_classes.py | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/astroid/bases.py b/astroid/bases.py index b32da908..47821b7b 100644 --- a/astroid/bases.py +++ b/astroid/bases.py @@ -645,7 +645,7 @@ class NodeNG(object): warnings.warn('%s.infered() is deprecated and slated for removal ' 'in astroid 2.0, use %s.inferred() instead.' % (type(self).__name__, type(self).__name__), - PendingDeprecationWarning) + PendingDeprecationWarning, stacklevel=2) return self.inferred() def instanciate_class(self): diff --git a/astroid/mixins.py b/astroid/mixins.py index 0882268f..57082f0f 100644 --- a/astroid/mixins.py +++ b/astroid/mixins.py @@ -62,7 +62,7 @@ class FilterStmtsMixin(object): warnings.warn('%s.ass_type() is deprecated and slated for removal ' 'in astroid 2.0, use %s.assign_type() instead.' % (type(self).__name__, type(self).__name__), - PendingDeprecationWarning) + PendingDeprecationWarning, stacklevel=2) return self.assign_type() @@ -75,7 +75,7 @@ class AssignTypeMixin(object): warnings.warn('%s.ass_type() is deprecated and slated for removal ' 'in astroid 2.0, use %s.assign_type() instead.' % (type(self).__name__, type(self).__name__), - PendingDeprecationWarning) + PendingDeprecationWarning, stacklevel=2) return self.assign_type() def _get_filtered_stmts(self, lookup_node, node, _stmts, mystmt): @@ -98,7 +98,7 @@ class ParentAssignTypeMixin(AssignTypeMixin): warnings.warn('%s.ass_type() is deprecated and slated for removal ' 'in astroid 2.0, use %s.assign_type() instead.' % (type(self).__name__, type(self).__name__), - PendingDeprecationWarning) + PendingDeprecationWarning, stacklevel=2) return self.assign_type() diff --git a/astroid/node_classes.py b/astroid/node_classes.py index 6548007f..c43fbfa2 100644 --- a/astroid/node_classes.py +++ b/astroid/node_classes.py @@ -668,7 +668,7 @@ class Comprehension(bases.NodeNG): warnings.warn('%s.ass_type() is deprecated and slated for removal' 'in astroid 2.0, use %s.assign_type() instead.' % (type(self).__name__, type(self).__name__), - PendingDeprecationWarning) + PendingDeprecationWarning, stacklevel=2) return self.assign_type() def _get_filtered_stmts(self, lookup_node, node, stmts, mystmt): |