diff options
author | Sylvain <syt@logilab.fr> | 2007-07-20 16:10:27 +0200 |
---|---|---|
committer | Sylvain <syt@logilab.fr> | 2007-07-20 16:10:27 +0200 |
commit | 92e8464ef5efddceddc8e82d2c8fde857f08a402 (patch) | |
tree | 606a284d7bcb01a8e50f18dfcf81ab2daa8636b0 | |
parent | 3761a2b2e9fd8f90fa5f82d5e1714483d2f2a04a (diff) | |
download | pylint-92e8464ef5efddceddc8e82d2c8fde857f08a402.tar.gz |
applied Stefan Rank patch
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | checkers/imports.py | 8 |
2 files changed, 9 insertions, 4 deletions
@@ -5,7 +5,8 @@ ChangeLog for PyLint * fix #3733: Messages (dis)appear depending on order of file names * fix #4026: pylint.el should require compile * implement #4012: flag back tick as deprecated (new W0333 message) - + * applied patch from Stefan Rank to avoid W0410 false positive when + multiple "from __future__" import statements 2007-06-07 -- 0.13.2 * fix disable-checker option so that it won't accidentally enable the @@ -13,7 +14,7 @@ ChangeLog for PyLint * added note about the gedit plugin into documentation 2007-03-02 -- 0.13.1 - * fix some unexplained 0.13.0 packaging issue which led a bunch of + * fix some unexplained 0.13.0 packaging issue which led to a bunch of files missing from the distribution 2007-02-28 -- 0.13.0 diff --git a/checkers/imports.py b/checkers/imports.py index 921d8b6..40a7d97 100644 --- a/checkers/imports.py +++ b/checkers/imports.py @@ -246,8 +246,12 @@ given file (report R0402 must not be disabled)'} basename = node.modname if basename == '__future__': # check this is the first non docstring statement in the module - if node.previous_sibling(): - self.add_message('W0410', node=node) + prev = node.previous_sibling() + if prev: + # consecutive future statements are possible + if not(isinstance(prev, astng.From) + and prev.modname == '__future__'): + self.add_message('W0410', node=node) self._check_deprecated(node, basename) relative = self._check_relative(node, basename) for name, _ in node.names: |