Index: Lib/CGIHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/CGIHTTPServer.py,v retrieving revision 1.21 diff -c -r1.21 CGIHTTPServer.py *** Lib/CGIHTTPServer.py 1 Feb 2002 16:27:59 -0000 1.21 --- Lib/CGIHTTPServer.py 20 Mar 2002 21:20:27 -0000 *************** *** 235,241 **** self.log_message("command: %s", cmdline) try: nbytes = int(length) ! except: nbytes = 0 files = popenx(cmdline, 'b') fi = files[0] --- 235,241 ---- self.log_message("command: %s", cmdline) try: nbytes = int(length) ! except ValueError: nbytes = 0 files = popenx(cmdline, 'b') fi = files[0] Index: Lib/cgi.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/cgi.py,v retrieving revision 1.69 diff -c -r1.69 cgi.py *** Lib/cgi.py 11 Feb 2002 17:57:55 -0000 1.69 --- Lib/cgi.py 20 Mar 2002 21:20:27 -0000 *************** *** 506,512 **** if self.headers.has_key('content-length'): try: clen = int(self.headers['content-length']) ! except: pass if maxlen and clen > maxlen: raise ValueError, 'Maximum content length exceeded' --- 506,512 ---- if self.headers.has_key('content-length'): try: clen = int(self.headers['content-length']) ! except (KeyError, ValueError): pass if maxlen and clen > maxlen: raise ValueError, 'Maximum content length exceeded' Index: Lib/cmd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/cmd.py,v retrieving revision 1.26 diff -c -r1.26 cmd.py *** Lib/cmd.py 9 Aug 2001 21:40:30 -0000 1.26 --- Lib/cmd.py 20 Mar 2002 21:20:27 -0000 *************** *** 213,225 **** # XXX check arg syntax try: func = getattr(self, 'help_' + arg) ! except: try: doc=getattr(self, 'do_' + arg).__doc__ if doc: print doc return ! except: pass print self.nohelp % (arg,) return --- 213,225 ---- # XXX check arg syntax try: func = getattr(self, 'help_' + arg) ! except AttributeError: try: doc=getattr(self, 'do_' + arg).__doc__ if doc: print doc return ! except AttributeError: pass print self.nohelp % (arg,) return Index: Lib/code.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/code.py,v retrieving revision 1.18 diff -c -r1.18 code.py *** Lib/code.py 18 Sep 2001 13:33:01 -0000 1.18 --- Lib/code.py 20 Mar 2002 21:20:27 -0000 *************** *** 136,142 **** try: # Assume SyntaxError is a class exception value = SyntaxError(msg, (filename, lineno, offset, line)) ! except: # If that failed, assume SyntaxError is a string value = msg, (filename, lineno, offset, line) sys.last_value = value --- 136,142 ---- try: # Assume SyntaxError is a class exception value = SyntaxError(msg, (filename, lineno, offset, line)) ! except TypeError: # If that failed, assume SyntaxError is a string value = msg, (filename, lineno, offset, line) sys.last_value = value *************** *** 302,308 **** else: try: import readline ! except: pass console.interact(banner) --- 302,308 ---- else: try: import readline ! except ImportError: pass console.interact(banner) Index: Lib/fileinput.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/fileinput.py,v retrieving revision 1.8 diff -c -r1.8 fileinput.py *** Lib/fileinput.py 24 Oct 2001 20:33:34 -0000 1.8 --- Lib/fileinput.py 20 Mar 2002 21:20:27 -0000 *************** *** 203,209 **** self._backupfilename = 0 if backupfilename and not self._backup: try: os.unlink(backupfilename) ! except: pass self._isstdin = 0 self._buffer = [] --- 203,209 ---- self._backupfilename = 0 if backupfilename and not self._backup: try: os.unlink(backupfilename) ! except OSError: pass self._isstdin = 0 self._buffer = [] *************** *** 243,249 **** self._file = open(self._backupfilename, "r") try: perm = os.fstat(self._file.fileno())[stat.ST_MODE] ! except: self._output = open(self._filename, "w") else: fd = os.open(self._filename, --- 243,249 ---- self._file = open(self._backupfilename, "r") try: perm = os.fstat(self._file.fileno())[stat.ST_MODE] ! except OSError: self._output = open(self._filename, "w") else: fd = os.open(self._filename, *************** *** 252,258 **** self._output = os.fdopen(fd, "w") try: os.chmod(self._filename, perm) ! except: pass self._savestdout = sys.stdout sys.stdout = self._output --- 252,258 ---- self._output = os.fdopen(fd, "w") try: os.chmod(self._filename, perm) ! except OSError: pass self._savestdout = sys.stdout sys.stdout = self._output Index: Lib/httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v retrieving revision 1.47 diff -c -r1.47 httplib.py *** Lib/httplib.py 18 Mar 2002 22:51:48 -0000 1.47 --- Lib/httplib.py 20 Mar 2002 21:20:27 -0000 *************** *** 347,353 **** if port is None: i = host.find(':') if i >= 0: ! port = int(host[i+1:]) host = host[:i] else: port = self.default_port --- 347,356 ---- if port is None: i = host.find(':') if i >= 0: ! try: ! port = int(host[i+1:]) ! except ValueError: ! raise InvalidURL, "nonnumeric port" host = host[:i] else: port = self.default_port *************** *** 806,811 **** --- 809,817 ---- pass class NotConnected(HTTPException): + pass + + class InvalidURL(HTTPException): pass class UnknownProtocol(HTTPException): Index: Lib/inspect.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/inspect.py,v retrieving revision 1.28 diff -c -r1.28 inspect.py *** Lib/inspect.py 17 Mar 2002 18:56:20 -0000 1.28 --- Lib/inspect.py 20 Mar 2002 21:20:27 -0000 *************** *** 765,771 **** """Return the frame object for the caller's stack frame.""" try: raise 'catch me' ! except: return sys.exc_traceback.tb_frame.f_back if hasattr(sys, '_getframe'): currentframe = sys._getframe --- 765,771 ---- """Return the frame object for the caller's stack frame.""" try: raise 'catch me' ! except 'catch me': return sys.exc_traceback.tb_frame.f_back if hasattr(sys, '_getframe'): currentframe = sys._getframe Index: Lib/locale.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/locale.py,v retrieving revision 1.19 diff -c -r1.19 locale.py *** Lib/locale.py 13 Aug 2001 14:50:44 -0000 1.19 --- Lib/locale.py 20 Mar 2002 21:20:27 -0000 *************** *** 719,725 **** try: LC_MESSAGES ! except: pass else: __all__.append("LC_MESSAGES") --- 719,725 ---- try: LC_MESSAGES ! except NameError: pass else: __all__.append("LC_MESSAGES") Index: Lib/mimetools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mimetools.py,v retrieving revision 1.23 diff -c -r1.23 mimetools.py *** Lib/mimetools.py 23 Feb 2001 20:04:54 -0000 1.23 --- Lib/mimetools.py 20 Mar 2002 21:20:27 -0000 *************** *** 116,126 **** hostid = socket.gethostbyname(socket.gethostname()) try: uid = `os.getuid()` ! except: uid = '1' try: pid = `os.getpid()` ! except: pid = '1' _prefix = hostid + '.' + uid + '.' + pid timestamp = '%.3f' % time.time() --- 116,126 ---- hostid = socket.gethostbyname(socket.gethostname()) try: uid = `os.getuid()` ! except AttributeError: uid = '1' try: pid = `os.getpid()` ! except AttributeError: pid = '1' _prefix = hostid + '.' + uid + '.' + pid timestamp = '%.3f' % time.time() Index: Lib/popen2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/popen2.py,v retrieving revision 1.23 diff -c -r1.23 popen2.py *** Lib/popen2.py 12 Mar 2002 19:48:03 -0000 1.23 --- Lib/popen2.py 20 Mar 2002 21:20:28 -0000 *************** *** 62,68 **** for i in range(3, MAXFD): try: os.close(i) ! except: pass try: os.execvp(cmd[0], cmd) --- 62,68 ---- for i in range(3, MAXFD): try: os.close(i) ! except OSError: pass try: os.execvp(cmd[0], cmd) Index: Lib/quopri.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/quopri.py,v retrieving revision 1.18 diff -c -r1.18 quopri.py *** Lib/quopri.py 15 Oct 2001 18:44:01 -0000 1.18 --- Lib/quopri.py 20 Mar 2002 21:20:28 -0000 *************** *** 13,19 **** try: from binascii import a2b_qp, b2a_qp ! except: a2b_qp = None b2a_qp = None --- 13,19 ---- try: from binascii import a2b_qp, b2a_qp ! except ImportError: a2b_qp = None b2a_qp = None