]> granicus.if.org Git - python/commitdiff
Merge typo fixes from 3.5
authorMartin Panter <vadmium+py@gmail.com>
Tue, 5 Apr 2016 06:20:32 +0000 (06:20 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Tue, 5 Apr 2016 06:20:32 +0000 (06:20 +0000)
1  2 
Doc/library/dis.rst
Include/unicodeobject.h
Lib/http/client.py
Lib/test/test_argparse.py
Lib/warnings.py
Misc/NEWS
README

Simple merge
Simple merge
Simple merge
Simple merge
diff --cc Lib/warnings.py
index 1ece5149f4be57dd14e3588aebdc95fc63be86b6,dfa13ee3fc5bfeb6150bf2ae3a90ad4fdf002e6c..f4c8cdc49234d0d58072a24c16b3c417150090c5
@@@ -22,32 -12,24 +22,32 @@@ def _showwarnmsg_impl(msg)
      if file is None:
          file = sys.stderr
          if file is None:
 -            # sys.stderr is None when run with pythonw.exe - warnings get lost
 +            # sys.stderr is None when run with pythonw.exe:
 +            # warnings get lost
              return
 +    text = _formatwarnmsg(msg)
      try:
 -        file.write(formatwarning(message, category, filename, lineno, line))
 +        file.write(text)
      except OSError:
 -        pass # the file (probably stderr) is invalid - this warning gets lost.
 +        # the file (probably stderr) is invalid - this warning gets lost.
 +        pass
  
 -def formatwarning(message, category, filename, lineno, line=None):
 -    """Function to format a warning the standard way."""
 -    s =  "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message)
 -    if line is None:
 +def _formatwarnmsg_impl(msg):
 +    s =  ("%s:%s: %s: %s\n"
 +          % (msg.filename, msg.lineno, msg.category.__name__,
 +             msg.message))
 +
 +    if msg.line is None:
          try:
              import linecache
 -            line = linecache.getline(filename, lineno)
 +            line = linecache.getline(msg.filename, msg.lineno)
          except Exception:
              # When a warning is logged during Python shutdown, linecache
-             # and the improt machinery don't work anymore
+             # and the import machinery don't work anymore
              line = None
 +            linecache = None
 +    else:
 +        line = msg.line
      if line:
          line = line.strip()
          s += "  %s\n" % line
diff --cc Misc/NEWS
Simple merge
diff --cc README
Simple merge