]> granicus.if.org Git - python/commitdiff
Merged revisions 73824,78887,78895,78900,79024 via svnmerge from
authorEzio Melotti <ezio.melotti@gmail.com>
Tue, 23 Mar 2010 13:20:39 +0000 (13:20 +0000)
committerEzio Melotti <ezio.melotti@gmail.com>
Tue, 23 Mar 2010 13:20:39 +0000 (13:20 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73824 | ezio.melotti | 2009-07-04 04:18:08 +0300 (Sat, 04 Jul 2009) | 1 line

  #6398 typo: versio. -> version.
........
  r78887 | ezio.melotti | 2010-03-13 02:15:36 +0200 (Sat, 13 Mar 2010) | 1 line

  fix broken links
........
  r78895 | ezio.melotti | 2010-03-13 03:21:34 +0200 (Sat, 13 Mar 2010) | 1 line

  #8011: use exc.tb_lineno instead of traceback.tb_lineno() and pep8ify variable names.
........
  r78900 | ezio.melotti | 2010-03-13 06:39:51 +0200 (Sat, 13 Mar 2010) | 1 line

  Silence compiler warnings.
........
  r79024 | ezio.melotti | 2010-03-17 16:22:34 +0200 (Wed, 17 Mar 2010) | 1 line

  Use "x in y" instead of y.find(x) != -1.
........

Doc/library/bz2.rst
Doc/library/traceback.rst
Lib/test/test_file.py
Lib/test/test_fileio.py
Lib/test/test_minidom.py
Modules/_cursesmodule.c
README

index 7804c545054ecd2d8d4e81f25144fb069008754e..bf8ebc0d7422699fdcef3d550c57a9d240ac425e 100644 (file)
@@ -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;
 
index 9c8c93f1884d346ae2ec794da612148914feffe5..15eaa6e0185c1b1097f8bb931b7518d2c7da8b8b 100644 (file)
@@ -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::
index ed100c14b750af81a4ba87be101ff5dfa7023931..c5e5ea16df7d2aa4db8bf9e47bd94e8f971afa1f 100644 (file)
@@ -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.
index 0eea86b309eaae02527ca2b1ba3654e3c103b260..d1b3751ef70d7a8f23596b3506a6f4f485225906 100644 (file)
@@ -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.
index 16977a5495b496c485d68c452b5374c9573231fc..120c37cd7432a9a854ced0a2758434377154c6e2 100644 (file)
@@ -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):
index e2c17e1c18731a1f90b910b445ffc3e3692c1d95..2ea1488a0d65767aa0893c1ef175cb5e0e3abc6d 100644 (file)
@@ -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 7dd1fe8b222a6a94ae63389ddfefb538ec161e0b..bc40ec82cf0adf52d39eef6adfd003426d61ed06 100644 (file)
--- 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