diff --git a/Doc/library/bz2.rst b/Doc/library/bz2.rst index 7804c545054..bf8ebc0d742 100644 --- a/Doc/library/bz2.rst +++ b/Doc/library/bz2.rst @@ -20,9 +20,10 @@ For other archive formats, see the :mod:`gzip`, :mod:`zipfile`, and Here is a summary of the features offered by the bz2 module: * :class:`BZ2File` class implements a complete file interface, including - :meth:`readline`, :meth:`readlines`, :meth:`writelines`, :meth:`seek`, etc; + :meth:`~BZ2File.readline`, :meth:`~BZ2File.readlines`, + :meth:`~BZ2File.writelines`, :meth:`~BZ2File.seek`, etc; -* :class:`BZ2File` class implements emulated :meth:`seek` support; +* :class:`BZ2File` class implements emulated :meth:`~BZ2File.seek` support; * :class:`BZ2File` class implements universal newline support; diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst index 9c8c93f1884..15eaa6e0185 100644 --- a/Doc/library/traceback.rst +++ b/Doc/library/traceback.rst @@ -175,12 +175,12 @@ exception and traceback:: try: lumberjack() - except: - exceptionType, exceptionValue, exceptionTraceback = sys.exc_info() + except IndexError: + exc_type, exc_value, exc_traceback = sys.exc_info() print "*** print_tb:" - traceback.print_tb(exceptionTraceback, limit=1, file=sys.stdout) + traceback.print_tb(exc_traceback, limit=1, file=sys.stdout) print "*** print_exception:" - traceback.print_exception(exceptionType, exceptionValue, exceptionTraceback, + traceback.print_exception(exc_type, exc_value, exc_traceback, limit=2, file=sys.stdout) print "*** print_exc:" traceback.print_exc() @@ -189,13 +189,13 @@ exception and traceback:: print formatted_lines[0] print formatted_lines[-1] print "*** format_exception:" - print repr(traceback.format_exception(exceptionType, exceptionValue, - exceptionTraceback)) + print repr(traceback.format_exception(exc_type, exc_value, + exc_traceback)) print "*** extract_tb:" - print repr(traceback.extract_tb(exceptionTraceback)) + print repr(traceback.extract_tb(exc_traceback)) print "*** format_tb:" - print repr(traceback.format_tb(exceptionTraceback)) - print "*** tb_lineno:", traceback.tb_lineno(exceptionTraceback) + print repr(traceback.format_tb(exc_traceback)) + print "*** tb_lineno:", exc_traceback.tb_lineno The output for the example would look similar to this:: diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index ed100c14b75..c5e5ea16df7 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -220,7 +220,7 @@ class OtherFileTests(unittest.TestCase): except ValueError, msg: if msg[0] != 0: s = str(msg) - if s.find(TESTFN) != -1 or s.find(bad_mode) == -1: + if TESTFN in s or bad_mode not in s: self.fail("bad error message for invalid mode: %s" % s) # if msg[0] == 0, we're probably on Windows where there may be # no obvious way to discover why open() failed. diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py index 0eea86b309e..d1b3751ef70 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py @@ -189,7 +189,7 @@ class OtherFileTests(unittest.TestCase): except ValueError as msg: if msg.args[0] != 0: s = str(msg) - if s.find(TESTFN) != -1 or s.find(bad_mode) == -1: + if TESTFN in s or bad_mode not in s: self.fail("bad error message for invalid mode: %s" % s) # if msg.args[0] == 0, we're probably on Windows where there may be # no obvious way to discover why open() failed. diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index 16977a5495b..120c37cd743 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -439,7 +439,7 @@ class MinidomTest(unittest.TestCase): string1 = repr(el) string2 = str(el) self.confirm(string1 == string2) - self.confirm(string1.find("slash:abc") != -1) + self.confirm("slash:abc" in string1) dom.unlink() def testAttributeRepr(self): diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index e2c17e1c187..2ea1488a0d6 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -450,14 +450,14 @@ PyCursesWindow_AddStr(PyCursesWindowObject *self, PyObject *args) if (use_attr == TRUE) { attr_old = getattrs(self->win); - wattrset(self->win,attr); + (void)wattrset(self->win,attr); } if (use_xy == TRUE) rtn = mvwaddstr(self->win,y,x,str); else rtn = waddstr(self->win,str); if (use_attr == TRUE) - wattrset(self->win,attr_old); + (void)wattrset(self->win,attr_old); return PyCursesCheckERR(rtn, "addstr"); } @@ -499,14 +499,14 @@ PyCursesWindow_AddNStr(PyCursesWindowObject *self, PyObject *args) if (use_attr == TRUE) { attr_old = getattrs(self->win); - wattrset(self->win,attr); + (void)wattrset(self->win,attr); } if (use_xy == TRUE) rtn = mvwaddnstr(self->win,y,x,str,n); else rtn = waddnstr(self->win,str,n); if (use_attr == TRUE) - wattrset(self->win,attr_old); + (void)wattrset(self->win,attr_old); return PyCursesCheckERR(rtn, "addnstr"); } @@ -1140,14 +1140,14 @@ PyCursesWindow_InsStr(PyCursesWindowObject *self, PyObject *args) if (use_attr == TRUE) { attr_old = getattrs(self->win); - wattrset(self->win,attr); + (void)wattrset(self->win,attr); } if (use_xy == TRUE) rtn = mvwinsstr(self->win,y,x,str); else rtn = winsstr(self->win,str); if (use_attr == TRUE) - wattrset(self->win,attr_old); + (void)wattrset(self->win,attr_old); return PyCursesCheckERR(rtn, "insstr"); } @@ -1189,14 +1189,14 @@ PyCursesWindow_InsNStr(PyCursesWindowObject *self, PyObject *args) if (use_attr == TRUE) { attr_old = getattrs(self->win); - wattrset(self->win,attr); + (void)wattrset(self->win,attr); } if (use_xy == TRUE) rtn = mvwinsnstr(self->win,y,x,str,n); else rtn = winsnstr(self->win,str,n); if (use_attr == TRUE) - wattrset(self->win,attr_old); + (void)wattrset(self->win,attr_old); return PyCursesCheckERR(rtn, "insnstr"); } diff --git a/README b/README index 7dd1fe8b222..bc40ec82cf0 100644 --- a/README +++ b/README @@ -939,7 +939,7 @@ Installing multiple versions On Unix and Mac systems if you intend to install multiple versions of Python using the same installation prefix (--prefix argument to the configure script) you must take care that your primary python executable is not -overwritten by the installation of a different versio. All files and +overwritten by the installation of a different version. All files and directories installed using "make altinstall" contain the major and minor version and can thus live side-by-side. "make install" also creates ${prefix}/bin/python which refers to ${prefix}/bin/pythonX.Y. If you intend