]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Merge pull request #436 from akx/correct-lies
authorAarni Koskela <akx@iki.fi>
Wed, 21 Sep 2016 04:58:48 +0000 (07:58 +0300)
committerGitHub <noreply@github.com>
Wed, 21 Sep 2016 04:58:48 +0000 (07:58 +0300)
Straighten up lying extraction docstrings

1  2 
babel/messages/extract.py

index 1aade43f94f9a9113da1b916802df1f837485f6b,030c3f58814c4d574d5e76fd454e481ee022dcf1..efddbf5e691c23c9a2e7cf1af5308e72897a7e90
@@@ -229,10 -232,15 +232,12 @@@ def extract_from_file(method, filename
      :param strip_comment_tags: a flag that if set to `True` causes all comment
                                 tags to be removed from the collected comments.
      :param options: a dictionary of additional options (optional)
+     :returns: list of tuples of the form ``(lineno, message, comments, context)``
+     :rtype: list[tuple[int, str|tuple[str], list[str], str|None]
      """
 -    fileobj = open(filename, 'rb')
 -    try:
 +    with open(filename, 'rb') as fileobj:
          return list(extract(method, fileobj, keywords, comment_tags, options,
                              strip_comment_tags))
 -    finally:
 -        fileobj.close()
  
  
  def extract(method, fileobj, keywords=DEFAULT_KEYWORDS, comment_tags=(),