Hello community, here is the log from the commit of package python-pyflakes for openSUSE:Factory checked in at 2013-05-16 11:27:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pyflakes (Old) and /work/SRC/openSUSE:Factory/.python-pyflakes.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyflakes" Changes: -------- --- /work/SRC/openSUSE:Factory/python-pyflakes/python-pyflakes.changes 2013-04-22 14:32:13.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-pyflakes.new/python-pyflakes.changes 2013-05-16 11:27:08.000000000 +0200 @@ -1,0 +2,12 @@ +Mon May 13 08:52:47 UTC 2013 - [email protected] + +- update to 0.7.2: + - Fix computation of `DoctestSyntaxError.lineno` and `col`. + - Add boolean attribute `Checker.withDoctest` to ignore doctests. + - If environment variable `PYFLAKES_NODOCTEST` is set, skip doctests. + - Environment variable `PYFLAKES_BUILTINS` accepts a comma-separated + list of additional built-in names. + - File `bin/pyflakes` was missing in tarball generated with distribute. + - Fix reporting errors in non-ASCII filenames (Python 2.x) + +------------------------------------------------------------------- Old: ---- pyflakes-0.7.tar.gz New: ---- pyflakes-0.7.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyflakes.spec ++++++ --- /var/tmp/diff_new_pack.DJbACu/_old 2013-05-16 11:27:08.000000000 +0200 +++ /var/tmp/diff_new_pack.DJbACu/_new 2013-05-16 11:27:08.000000000 +0200 @@ -20,7 +20,7 @@ %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: python-pyflakes -Version: 0.7 +Version: 0.7.2 Release: 0 Url: https://launchpad.net/pyflakes Summary: Passive checker of Python programs ++++++ python3-pyflakes.spec ++++++ --- /var/tmp/diff_new_pack.DJbACu/_old 2013-05-16 11:27:08.000000000 +0200 +++ /var/tmp/diff_new_pack.DJbACu/_new 2013-05-16 11:27:08.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-pyflakes -Version: 0.7 +Version: 0.7.2 Release: 0 Url: https://launchpad.net/pyflakes Summary: Passive checker of Python 3 programs ++++++ pyflakes-0.7.tar.gz -> pyflakes-0.7.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/MANIFEST.in new/pyflakes-0.7.2/MANIFEST.in --- old/pyflakes-0.7/MANIFEST.in 2013-04-17 09:42:42.000000000 +0200 +++ new/pyflakes-0.7.2/MANIFEST.in 2013-04-21 13:02:47.000000000 +0200 @@ -1,2 +1,3 @@ -include NEWS.txt +include README.rst NEWS.txt include AUTHORS LICENSE +include bin/pyflakes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/NEWS.txt new/pyflakes-0.7.2/NEWS.txt --- old/pyflakes-0.7/NEWS.txt 2013-04-16 19:46:41.000000000 +0200 +++ new/pyflakes-0.7.2/NEWS.txt 2013-04-24 14:26:46.000000000 +0200 @@ -1,3 +1,14 @@ +0.7.2 (2013-04-24): + - Fix computation of `DoctestSyntaxError.lineno` and `col`. + - Add boolean attribute `Checker.withDoctest` to ignore doctests. + - If environment variable `PYFLAKES_NODOCTEST` is set, skip doctests. + - Environment variable `PYFLAKES_BUILTINS` accepts a comma-separated + list of additional built-in names. + +0.7.1 (2013-04-23): + - File `bin/pyflakes` was missing in tarball generated with distribute. + - Fix reporting errors in non-ASCII filenames (Python 2.x). + 0.7.0 (2013-04-17): - Add --version and --help options. - Support `python -m pyflakes` (Python 2.7 and Python 3.x). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/PKG-INFO new/pyflakes-0.7.2/PKG-INFO --- old/pyflakes-0.7/PKG-INFO 2013-04-17 11:13:19.000000000 +0200 +++ new/pyflakes-0.7.2/PKG-INFO 2013-04-24 14:40:49.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyflakes -Version: 0.7 +Version: 0.7.2 Summary: passive checker of Python programs Home-page: https://launchpad.net/pyflakes Author: Florent Xicluna diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/bin/pyflakes new/pyflakes-0.7.2/bin/pyflakes --- old/pyflakes-0.7/bin/pyflakes 1970-01-01 01:00:00.000000000 +0100 +++ new/pyflakes-0.7.2/bin/pyflakes 2013-01-27 16:33:07.000000000 +0100 @@ -0,0 +1,3 @@ +#!/usr/bin/env python +from pyflakes.scripts.pyflakes import main +main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes/__init__.py new/pyflakes-0.7.2/pyflakes/__init__.py --- old/pyflakes-0.7/pyflakes/__init__.py 2013-04-16 20:47:44.000000000 +0200 +++ new/pyflakes-0.7.2/pyflakes/__init__.py 2013-04-24 14:27:12.000000000 +0200 @@ -1,2 +1,2 @@ -__version__ = '0.7' +__version__ = '0.7.2' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes/api.py new/pyflakes-0.7.2/pyflakes/api.py --- old/pyflakes-0.7/pyflakes/api.py 2013-03-29 21:42:27.000000000 +0100 +++ new/pyflakes-0.7.2/pyflakes/api.py 2013-04-23 07:36:53.000000000 +0200 @@ -1,6 +1,7 @@ """ API for the command-line I{pyflakes} tool. """ +from __future__ import with_statement import sys import os @@ -53,13 +54,12 @@ except Exception: reporter.unexpectedError(filename, 'problem decoding source') return 1 - else: - # Okay, it's syntactically valid. Now check it. - w = checker.Checker(tree, filename) - w.messages.sort(key=lambda m: m.lineno) - for warning in w.messages: - reporter.flake(warning) - return len(w.messages) + # Okay, it's syntactically valid. Now check it. + w = checker.Checker(tree, filename) + w.messages.sort(key=lambda m: m.lineno) + for warning in w.messages: + reporter.flake(warning) + return len(w.messages) def checkPath(filename, reporter=None): @@ -74,17 +74,16 @@ if reporter is None: reporter = modReporter._makeDefaultReporter() try: - f = open(filename, 'U') - try: - return check(f.read() + '\n', filename, reporter) - finally: - f.close() + with open(filename, 'U') as f: + codestr = f.read() + '\n' except UnicodeError: reporter.unexpectedError(filename, 'problem decoding source') + return 1 except IOError: msg = sys.exc_info()[1] reporter.unexpectedError(filename, msg.args[1]) - return 1 + return 1 + return check(codestr, filename, reporter) def iterSourceCode(paths): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes/checker.py new/pyflakes-0.7.2/pyflakes/checker.py --- old/pyflakes-0.7/pyflakes/checker.py 2013-04-16 19:39:05.000000000 +0200 +++ new/pyflakes-0.7.2/pyflakes/checker.py 2013-04-24 14:10:46.000000000 +0200 @@ -5,13 +5,13 @@ Also, it models the Bindings and Scopes. """ import doctest -import os.path +import os import sys try: - import builtins + builtin_vars = dir(__import__('builtins')) PY2 = False except ImportError: - import __builtin__ as builtins + builtin_vars = dir(__import__('__builtin__')) PY2 = True try: @@ -158,7 +158,8 @@ importStarred = False # set to True when import * is found def __repr__(self): - return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), dict.__repr__(self)) + scope_cls = self.__class__.__name__ + return '<%s at 0x%x %s>' % (scope_cls, id(self), dict.__repr__(self)) class ClassScope(Scope): @@ -172,7 +173,8 @@ @ivar globals: Names declared 'global' in this function. """ usesLocals = False - alwaysUsed = set(['__tracebackhide__', '__traceback_info__', '__traceback_supplement__']) + alwaysUsed = set(['__tracebackhide__', + '__traceback_info__', '__traceback_supplement__']) def __init__(self): super(FunctionScope, self).__init__() @@ -223,7 +225,13 @@ nodeDepth = 0 offset = None traceTree = False - builtIns = set(dir(builtins)) | set(_MAGIC_GLOBALS) + withDoctest = ('PYFLAKES_NODOCTEST' not in os.environ) + + builtIns = set(builtin_vars).union(_MAGIC_GLOBALS) + _customBuiltIns = os.environ.get('PYFLAKES_BUILTINS') + if _customBuiltIns: + builtIns.update(_customBuiltIns.split(',')) + del _customBuiltIns def __init__(self, tree, filename='(none)', builtins=None): self._nodeHandlers = {} @@ -294,7 +302,8 @@ export = isinstance(scope.get('__all__'), ExportBinding) if export: all = scope['__all__'].names() - if not scope.importStarred and os.path.basename(self.filename) != '__init__.py': + if not scope.importStarred and \ + os.path.basename(self.filename) != '__init__.py': # Look for possible mistakes in the export list undefined = set(all) - set(scope) for name in undefined: @@ -384,7 +393,8 @@ existing = scope.get(value.name) if (isinstance(existing, Importation) and not existing.used - and (not isinstance(value, Importation) or value.fullName == existing.fullName) + and (not isinstance(value, Importation) or + value.fullName == existing.fullName) and reportRedef and not self.differentForks(node, existing.source)): redefinedWhileUnused = True @@ -473,8 +483,8 @@ # if the name was defined in that scope, and the name has # been accessed already in the current scope, and hasn't # been declared global - if (name in scope and scope[name].used and scope[name].used[0] is self.scope - and name not in self.scope.globals): + used = name in scope and scope[name].used + if used and used[0] is self.scope and name not in self.scope.globals: # then it's probably a mistake self.report(messages.UndefinedLocal, scope[name].used[1], name, scope[name].source) @@ -483,7 +493,8 @@ parent = getattr(node, 'parent', None) if isinstance(parent, (ast.For, ast.comprehension, ast.Tuple, ast.List)): binding = Binding(name, node) - elif parent is not None and name == '__all__' and isinstance(self.scope, ModuleScope): + elif (parent is not None and name == '__all__' and + isinstance(self.scope, ModuleScope)): binding = ExportBinding(name, parent.value) else: binding = Assignment(name, node) @@ -518,7 +529,11 @@ def getDocstring(self, node): if isinstance(node, ast.Expr): node = node.value - return node.s if isinstance(node, ast.Str) else None + if not isinstance(node, ast.Str): + return (None, None) + # Computed incorrectly if the docstring has backslash + doctest_lineno = node.lineno - node.s.count('\n') - 1 + return (node.s, doctest_lineno) def handleNode(self, node, parent): if node is None: @@ -545,13 +560,14 @@ _getDoctestExamples = doctest.DocTestParser().get_examples def handleDoctests(self, node): - docstring = node.body and self.getDocstring(node.body[0]) - if not docstring: - return try: + docstring, node_lineno = self.getDocstring(node.body[0]) + if not docstring: + return examples = self._getDoctestExamples(docstring) - except ValueError: - # e.g. line 6 of the docstring for <string> has inconsistent leading whitespace: ... + except (ValueError, IndexError): + # e.g. line 6 of the docstring for <string> has inconsistent + # leading whitespace: ... return node_offset = self.offset or (0, 0) self.pushFunctionScope() @@ -560,11 +576,11 @@ tree = compile(example.source, "<doctest>", "exec", ast.PyCF_ONLY_AST) except SyntaxError: e = sys.exc_info()[1] - node.lineno += example.lineno + e.lineno - node.col_offset += example.indent + 4 + e.offset - self.report(messages.DoctestSyntaxError, node) + position = (node_lineno + example.lineno + e.lineno, + example.indent + 4 + e.offset) + self.report(messages.DoctestSyntaxError, node, position) else: - self.offset = (node_offset[0] + node.lineno + example.lineno, + self.offset = (node_offset[0] + node_lineno + example.lineno, node_offset[1] + example.indent + 4) self.handleChildren(tree) self.offset = node_offset @@ -683,7 +699,8 @@ self.handleNode(deco, node) self.addBinding(node, FunctionDefinition(node.name, node)) self.LAMBDA(node) - self.deferFunction(lambda: self.handleDoctests(node)) + if self.withDoctest: + self.deferFunction(lambda: self.handleDoctests(node)) def LAMBDA(self, node): args = [] @@ -761,7 +778,8 @@ for keywordNode in node.keywords: self.handleNode(keywordNode, node) self.pushClassScope() - self.deferFunction(lambda: self.handleDoctests(node)) + if self.withDoctest: + self.deferFunction(lambda: self.handleDoctests(node)) for stmt in node.body: self.handleNode(stmt, node) self.popScope() @@ -804,16 +822,19 @@ def TRY(self, node): handler_names = [] + # List the exception handlers for handler in node.handlers: if isinstance(handler.type, ast.Tuple): for exc_type in handler.type.elts: handler_names.append(getNodeName(exc_type)) elif handler.type: handler_names.append(getNodeName(handler.type)) + # Memorize the except handlers and process the body self.exceptHandlers.append(handler_names) for child in node.body: self.handleNode(child, node) self.exceptHandlers.pop() + # Process the other nodes: "except:", "else:", "finally:" for child in iter_child_nodes(node): if child not in node.body: self.handleNode(child, node) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes/messages.py new/pyflakes-0.7.2/pyflakes/messages.py --- old/pyflakes-0.7/pyflakes/messages.py 2013-04-16 19:39:05.000000000 +0200 +++ new/pyflakes-0.7.2/pyflakes/messages.py 2013-04-24 14:10:46.000000000 +0200 @@ -13,7 +13,8 @@ self.col = getattr(loc, 'col_offset', 0) def __str__(self): - return '%s:%s: %s' % (self.filename, self.lineno, self.message % self.message_args) + return '%s:%s: %s' % (self.filename, self.lineno, + self.message % self.message_args) class UnusedImport(Message): @@ -67,8 +68,10 @@ class DoctestSyntaxError(Message): message = 'syntax error in doctest' - def __init__(self, filename, loc): + def __init__(self, filename, loc, position=None): Message.__init__(self, filename, loc) + if position: + (self.lineno, self.col) = position self.message_args = () @@ -81,7 +84,8 @@ class UndefinedLocal(Message): - message = "local variable %r (defined in enclosing scope on line %r) referenced before assignment" + message = ('local variable %r (defined in enclosing scope on line %r) ' + 'referenced before assignment') def __init__(self, filename, loc, name, orig_loc): Message.__init__(self, filename, loc) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes/reporter.py new/pyflakes-0.7.2/pyflakes/reporter.py --- old/pyflakes-0.7/pyflakes/reporter.py 2013-04-03 23:43:46.000000000 +0200 +++ new/pyflakes-0.7.2/pyflakes/reporter.py 2013-04-23 07:36:53.000000000 +0200 @@ -3,10 +3,6 @@ """ import sys -try: - u = unicode -except NameError: - u = str class Reporter(object): @@ -37,7 +33,7 @@ @param msg: A message explaining the problem. @ptype msg: C{unicode} """ - self._stderr.write(u("%s: %s\n") % (filename, msg)) + self._stderr.write("%s: %s\n" % (filename, msg)) def syntaxError(self, filename, msg, lineno, offset, text): """ @@ -57,11 +53,11 @@ line = text.splitlines()[-1] if offset is not None: offset = offset - (len(text) - len(line)) - self._stderr.write(u('%s:%d: %s\n') % (filename, lineno, msg)) - self._stderr.write(u(line)) - self._stderr.write(u('\n')) + self._stderr.write('%s:%d: %s\n' % (filename, lineno, msg)) + self._stderr.write(line) + self._stderr.write('\n') if offset is not None: - self._stderr.write(u(" " * (offset + 1) + "^\n")) + self._stderr.write(" " * (offset + 1) + "^\n") def flake(self, message): """ @@ -69,8 +65,8 @@ @param: A L{pyflakes.messages.Message}. """ - self._stdout.write(u(message)) - self._stdout.write(u('\n')) + self._stdout.write(str(message)) + self._stdout.write('\n') def _makeDefaultReporter(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes/test/test_api.py new/pyflakes-0.7.2/pyflakes/test/test_api.py --- old/pyflakes-0.7/pyflakes/test/test_api.py 2013-04-03 23:43:46.000000000 +0200 +++ new/pyflakes-0.7.2/pyflakes/test/test_api.py 2013-04-23 07:36:53.000000000 +0200 @@ -7,10 +7,6 @@ import shutil import subprocess import tempfile -try: - from io import StringIO -except ImportError: - from StringIO import StringIO from unittest2 import skipIf, TestCase @@ -21,7 +17,11 @@ checkRecursive, iterSourceCode, ) -if sys.version_info >= (3,): + +if sys.version_info < (3,): + from cStringIO import StringIO +else: + from io import StringIO unichr = chr @@ -387,7 +387,8 @@ decoding_error = "%s: problem decoding source\n" % (sourcePath,) else: decoding_error = """\ -%s:1: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-2: truncated \\xXX escape +%s:1: (unicode error) 'unicodeescape' codec can't decode bytes \ +in position 0-2: truncated \\xXX escape foo = '\\xyz' %s""" % (sourcePath, ' ^\n' if sys.version_info >= (3, 2) else '') self.assertHasErrors( @@ -538,7 +539,8 @@ fd.write("import contraband\n".encode('ascii')) fd.close() d = self.runPyflakes([self.tempfilepath]) - self.assertEqual(d, ("%s\n" % UnusedImport(self.tempfilepath, Node(1), 'contraband'), '', 1)) + expected = UnusedImport(self.tempfilepath, Node(1), 'contraband') + self.assertEqual(d, ("%s\n" % expected, '', 1)) def test_errors(self): """ @@ -547,11 +549,13 @@ printed to stderr. """ d = self.runPyflakes([self.tempfilepath]) - self.assertEqual(d, ('', '%s: No such file or directory\n' % (self.tempfilepath,), 1)) + error_msg = '%s: No such file or directory\n' % (self.tempfilepath,) + self.assertEqual(d, ('', error_msg, 1)) def test_readFromStdin(self): """ If no arguments are passed to C{pyflakes} then it reads from stdin. """ d = self.runPyflakes([], stdin='import contraband'.encode('ascii')) - self.assertEqual(d, ("%s\n" % UnusedImport('<stdin>', Node(1), 'contraband'), '', 1)) + expected = UnusedImport('<stdin>', Node(1), 'contraband') + self.assertEqual(d, ("%s\n" % expected, '', 1)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes/test/test_doctests.py new/pyflakes-0.7.2/pyflakes/test/test_doctests.py --- old/pyflakes-0.7/pyflakes/test/test_doctests.py 2013-04-16 19:39:05.000000000 +0200 +++ new/pyflakes-0.7.2/pyflakes/test/test_doctests.py 2013-04-24 14:10:46.000000000 +0200 @@ -138,14 +138,27 @@ self.assertEqual(exc.col, 0) def test_syntaxErrorInDoctest(self): - exc = super(Test, self).flakes(''' - def doctest_stuff(): - """ - >>> from # line 4 - """ - ''', m.DoctestSyntaxError).messages[0] + exceptions = super(Test, self).flakes( + ''' + def doctest_stuff(): + """ + >>> from # line 4 + >>> fortytwo = 42 + >>> except Exception: + """ + ''', + m.DoctestSyntaxError, + m.DoctestSyntaxError, + m.DoctestSyntaxError).messages + exc = exceptions[0] self.assertEqual(exc.lineno, 4) self.assertEqual(exc.col, 26) + exc = exceptions[1] + self.assertEqual(exc.lineno, 5) + self.assertEqual(exc.col, 16) + exc = exceptions[2] + self.assertEqual(exc.lineno, 6) + self.assertEqual(exc.col, 18) def test_indentationErrorInDoctest(self): exc = super(Test, self).flakes(''' @@ -158,6 +171,24 @@ self.assertEqual(exc.lineno, 5) self.assertEqual(exc.col, 16) + def test_offsetWithMultiLineArgs(self): + (exc1, exc2) = super(Test, self).flakes( + ''' + def doctest_stuff(arg1, + arg2, + arg3): + """ + >>> assert + >>> this + """ + ''', + m.DoctestSyntaxError, + m.UndefinedName).messages + self.assertEqual(exc1.lineno, 6) + self.assertEqual(exc1.col, 19) + self.assertEqual(exc2.lineno, 7) + self.assertEqual(exc2.col, 12) + def test_doctestCanReferToFunction(self): super(Test, self).flakes(""" def foo(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes/test/test_imports.py new/pyflakes-0.7.2/pyflakes/test/test_imports.py --- old/pyflakes-0.7/pyflakes/test/test_imports.py 2013-04-04 19:58:10.000000000 +0200 +++ new/pyflakes-0.7.2/pyflakes/test/test_imports.py 2013-04-21 17:21:00.000000000 +0200 @@ -13,8 +13,10 @@ self.flakes('from baz import fu, bar', m.UnusedImport, m.UnusedImport) def test_aliasedImport(self): - self.flakes('import fu as FU, bar as FU', m.RedefinedWhileUnused, m.UnusedImport) - self.flakes('from moo import fu as FU, bar as FU', m.RedefinedWhileUnused, m.UnusedImport) + self.flakes('import fu as FU, bar as FU', + m.RedefinedWhileUnused, m.UnusedImport) + self.flakes('from moo import fu as FU, bar as FU', + m.RedefinedWhileUnused, m.UnusedImport) def test_usedImport(self): self.flakes('import fu; print(fu)') @@ -619,7 +621,7 @@ @skip("todo: requires evaluating attribute access") def test_importedInClass(self): - '''Imports in class scope can be used through self''' + """Imports in class scope can be used through self.""" self.flakes(''' class c: import i @@ -628,7 +630,7 @@ ''') def test_futureImport(self): - '''__future__ is special''' + """__future__ is special.""" self.flakes('from __future__ import division') self.flakes(''' "docstring is allowed before future import" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes/test/test_other.py new/pyflakes-0.7.2/pyflakes/test/test_other.py --- old/pyflakes-0.7/pyflakes/test/test_other.py 2013-04-15 22:33:11.000000000 +0200 +++ new/pyflakes-0.7.2/pyflakes/test/test_other.py 2013-04-21 17:21:28.000000000 +0200 @@ -274,7 +274,7 @@ """) def test_unaryPlus(self): - '''Don't die on unary +''' + """Don't die on unary +.""" self.flakes('+1') def test_undefinedBaseClass(self): @@ -446,14 +446,20 @@ ''') def test_varAugmentedAssignment(self): - """Augmented assignment of a variable is supported. We don't care about var refs""" + """ + Augmented assignment of a variable is supported. + We don't care about var refs. + """ self.flakes(''' foo = 0 foo += 1 ''') def test_attrAugmentedAssignment(self): - """Augmented assignment of attributes is supported. We don't care about attr refs""" + """ + Augmented assignment of attributes is supported. + We don't care about attr refs. + """ self.flakes(''' foo = None foo.bar += foo.baz @@ -549,8 +555,8 @@ def test_assignInListComprehension(self): """ - Don't warn when a variable in a list comprehension is assigned to but - not used. + Don't warn when a variable in a list comprehension is + assigned to but not used. """ self.flakes(''' def f(): @@ -559,7 +565,8 @@ def test_generatorExpression(self): """ - Don't warn when a variable in a generator expression is assigned to but not used. + Don't warn when a variable in a generator expression is + assigned to but not used. """ self.flakes(''' def f(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes/test/test_undefined_names.py new/pyflakes-0.7.2/pyflakes/test/test_undefined_names.py --- old/pyflakes-0.7/pyflakes/test/test_undefined_names.py 2013-04-03 23:43:46.000000000 +0200 +++ new/pyflakes-0.7.2/pyflakes/test/test_undefined_names.py 2013-04-21 17:29:15.000000000 +0200 @@ -63,11 +63,14 @@ self.flakes('__path__', filename='package/__init__.py') def test_globalImportStar(self): - '''Can't find undefined names with import *''' + """Can't find undefined names with import *.""" self.flakes('from fu import *; bar', m.ImportStarUsed) def test_localImportStar(self): - '''A local import * still allows undefined names to be found in upper scopes''' + """ + A local import * still allows undefined names to be found + in upper scopes. + """ self.flakes(''' def a(): from fu import * @@ -76,7 +79,7 @@ @skipIf(version_info >= (3,), 'obsolete syntax') def test_unpackedParameter(self): - '''Unpacked function parameters create bindings''' + """Unpacked function parameters create bindings.""" self.flakes(''' def a((bar, baz)): bar; baz @@ -84,7 +87,10 @@ @skip("todo") def test_definedByGlobal(self): - '''"global" can make an otherwise undefined name in another function defined''' + """ + "global" can make an otherwise undefined name in another function + defined. + """ self.flakes(''' def a(): global fu; fu = 1 def b(): fu @@ -101,11 +107,11 @@ ''', m.UndefinedName) def test_del(self): - '''del deletes bindings''' + """Del deletes bindings.""" self.flakes('a = 1; del a; a', m.UndefinedName) def test_delGlobal(self): - '''del a global binding from a function''' + """Del a global binding from a function.""" self.flakes(''' a = 1 def f(): @@ -115,11 +121,11 @@ ''') def test_delUndefined(self): - '''del an undefined name''' + """Del an undefined name.""" self.flakes('del a', m.UndefinedName) def test_globalFromNestedScope(self): - '''global names are available from nested scopes''' + """Global names are available from nested scopes.""" self.flakes(''' a = 1 def b(): @@ -229,7 +235,7 @@ ) def test_nestedClass(self): - '''nested classes can access enclosing scope''' + """Nested classes can access enclosing scope.""" self.flakes(''' def f(foo): class C: @@ -242,7 +248,7 @@ ''') def test_badNestedClass(self): - '''free variables in nested classes must bind at class creation''' + """Free variables in nested classes must bind at class creation.""" self.flakes(''' def f(): class C: @@ -253,7 +259,7 @@ ''', m.UndefinedName) def test_definedAsStarArgs(self): - '''star and double-star arg names are defined''' + """Star and double-star arg names are defined.""" self.flakes(''' def f(a, *b, **c): print(a, b, c) @@ -261,7 +267,7 @@ @skipIf(version_info < (3,), 'new in Python 3') def test_definedAsStarUnpack(self): - '''star names in unpack are defined''' + """Star names in unpack are defined.""" self.flakes(''' a, *b = range(10) print(a, b) @@ -277,7 +283,7 @@ @skipIf(version_info < (3,), 'new in Python 3') def test_keywordOnlyArgs(self): - '''kwonly arg names are defined''' + """Keyword-only arg names are defined.""" self.flakes(''' def f(*, a, b=None): print(a, b) @@ -291,7 +297,7 @@ @skipIf(version_info < (3,), 'new in Python 3') def test_keywordOnlyArgsUndefined(self): - '''typo in kwonly name''' + """Typo in kwonly name.""" self.flakes(''' def f(*, a, b=default_c): print(a, b) @@ -299,7 +305,7 @@ @skipIf(version_info < (3,), 'new in Python 3') def test_annotationUndefined(self): - """Undefined annotations""" + """Undefined annotations.""" self.flakes(''' from abc import note1, note2, note3, note4, note5 def func(a: note1, *args: note2, @@ -358,6 +364,7 @@ socket_map = {} ''', m.UndefinedName) + class NameTests(TestCase): """ Tests for some extra cases of name handling. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes.egg-info/PKG-INFO new/pyflakes-0.7.2/pyflakes.egg-info/PKG-INFO --- old/pyflakes-0.7/pyflakes.egg-info/PKG-INFO 2013-04-17 11:13:19.000000000 +0200 +++ new/pyflakes-0.7.2/pyflakes.egg-info/PKG-INFO 2013-04-24 14:40:48.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyflakes -Version: 0.7 +Version: 0.7.2 Summary: passive checker of Python programs Home-page: https://launchpad.net/pyflakes Author: Florent Xicluna diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7/pyflakes.egg-info/SOURCES.txt new/pyflakes-0.7.2/pyflakes.egg-info/SOURCES.txt --- old/pyflakes-0.7/pyflakes.egg-info/SOURCES.txt 2013-04-17 11:13:19.000000000 +0200 +++ new/pyflakes-0.7.2/pyflakes.egg-info/SOURCES.txt 2013-04-24 14:40:48.000000000 +0200 @@ -4,6 +4,7 @@ NEWS.txt README.rst setup.py +bin/pyflakes pyflakes/__init__.py pyflakes/__main__.py pyflakes/api.py -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
