[Python-modules-commits] [astroid] 01/04: Import astroid_1.4.8.orig.tar.gz

Sandro Tosi morph at moszumanska.debian.org
Tue Aug 16 18:33:09 UTC 2016


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository astroid.

commit 1d95a690a960a77d0affb65d19def4c700aa648f
Author: Sandro Tosi <morph at debian.org>
Date:   Tue Aug 16 19:21:55 2016 +0100

    Import astroid_1.4.8.orig.tar.gz
---
 ChangeLog                              |  8 ++++++++
 PKG-INFO                               |  2 +-
 astroid.egg-info/PKG-INFO              |  2 +-
 astroid/__pkginfo__.py                 |  2 +-
 astroid/scoped_nodes.py                |  2 +-
 astroid/tests/unittest_scoped_nodes.py | 12 ++++++++++++
 6 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e46a8fa..6009565 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
 Change log for the astroid package (used to be astng)
 =====================================================
 
+2016-07-27 -- 1.4.8
+
+    * Add `returns` into the proper order in FunctionDef._astroid_fields
+
+      The order is important, since it determines the last child,
+      which in turn determines the last line number of a scoped node.
+
+
 2016-07-07 -- 1.4.7
 
     * Stop saving assignment locals in ExceptHandlers, when the context is a store.
diff --git a/PKG-INFO b/PKG-INFO
index 76272c3..029a131 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: astroid
-Version: 1.4.7
+Version: 1.4.8
 Summary: A abstract syntax tree for Python with inference support.
 Home-page: https://github.com/PyCQA/astroid
 Author: Python Code Quality Authority
diff --git a/astroid.egg-info/PKG-INFO b/astroid.egg-info/PKG-INFO
index 76272c3..029a131 100644
--- a/astroid.egg-info/PKG-INFO
+++ b/astroid.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: astroid
-Version: 1.4.7
+Version: 1.4.8
 Summary: A abstract syntax tree for Python with inference support.
 Home-page: https://github.com/PyCQA/astroid
 Author: Python Code Quality Authority
diff --git a/astroid/__pkginfo__.py b/astroid/__pkginfo__.py
index 18a9e97..9a78a37 100644
--- a/astroid/__pkginfo__.py
+++ b/astroid/__pkginfo__.py
@@ -20,7 +20,7 @@ distname = 'astroid'
 
 modname = 'astroid'
 
-numversion = (1, 4, 7)
+numversion = (1, 4, 8)
 version = '.'.join([str(num) for num in numversion])
 
 install_requires = ['six', 'lazy_object_proxy', 'wrapt']
diff --git a/astroid/scoped_nodes.py b/astroid/scoped_nodes.py
index 2a23f0b..d78d151 100644
--- a/astroid/scoped_nodes.py
+++ b/astroid/scoped_nodes.py
@@ -708,7 +708,7 @@ class Lambda(mixins.FilterStmtsMixin, LocalsDictNodeNG):
 
 class FunctionDef(bases.Statement, Lambda):
     if six.PY3:
-        _astroid_fields = ('decorators', 'args', 'body', 'returns')
+        _astroid_fields = ('decorators', 'args', 'returns', 'body')
         returns = None
     else:
         _astroid_fields = ('decorators', 'args', 'body')
diff --git a/astroid/tests/unittest_scoped_nodes.py b/astroid/tests/unittest_scoped_nodes.py
index 0019ee0..a15c923 100644
--- a/astroid/tests/unittest_scoped_nodes.py
+++ b/astroid/tests/unittest_scoped_nodes.py
@@ -576,6 +576,18 @@ class FunctionNodeTest(ModuleLoader, unittest.TestCase):
         self.assertIsInstance(inferred, nodes.Const)
         self.assertEqual(inferred.value, 42)
 
+    @test_utils.require_version(minver='3.0')
+    def test_return_annotation_is_not_the_last(self):
+        func = builder.parse('''
+        def test() -> bytes:
+            pass
+            pass
+            return
+        ''').body[0]
+        last_child = func.last_child()
+        self.assertIsInstance(last_child, nodes.Return)
+        self.assertEqual(func.tolineno, 5)
+
 
 class ClassNodeTest(ModuleLoader, unittest.TestCase):
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/astroid.git



More information about the Python-modules-commits mailing list