[Python-checkins] CVS: python/dist/src/Lib CGIHTTPServer.py,1.23,1.24 StringIO.py,1.21,1.22 chunk.py,1.11,1.12 dospath.py,1.26,1.27 fileinput.py,1.9,1.10 gzip.py,1.30,1.31 macpath.py,1.34,1.35 ntpath.py,1.46,1.47 os2emxpath.py,1.2,1.3 posixpath.py,1.47,1.48 pprint.py,1.20,1.21 pydoc.py,1.61,1.62 rfc822.py,1.66,1.67 sre_parse.py,1.52,1.53 statcache.py,1.11,1.12 threading.py,1.22,1.23 urllib2.py,1.26,1.27 zipfile.py,1.20,1.21

Guido van Rossum gvanrossum@users.sourceforge.net
Sat, 06 Apr 2002 22:36:26 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv27254

Modified Files:
	CGIHTTPServer.py StringIO.py chunk.py dospath.py fileinput.py 
	gzip.py macpath.py ntpath.py os2emxpath.py posixpath.py 
	pprint.py pydoc.py rfc822.py sre_parse.py statcache.py 
	threading.py urllib2.py zipfile.py 
Log Message:
Partial introduction of bools where appropriate.

Index: CGIHTTPServer.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/CGIHTTPServer.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** CGIHTTPServer.py	4 Apr 2002 22:55:58 -0000	1.23
--- CGIHTTPServer.py	7 Apr 2002 06:36:22 -0000	1.24
***************
*** 308,312 ****
          st = os.stat(path)
      except os.error:
!         return 0
      return st[0] & 0111 != 0
  
--- 308,312 ----
          st = os.stat(path)
      except os.error:
!         return False
      return st[0] & 0111 != 0
  

Index: StringIO.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/StringIO.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** StringIO.py	11 Feb 2002 17:52:18 -0000	1.21
--- StringIO.py	7 Apr 2002 06:36:22 -0000	1.22
***************
*** 60,64 ****
          if self.closed:
              raise ValueError, "I/O operation on closed file"
!         return 0
  
      def seek(self, pos, mode = 0):
--- 60,64 ----
          if self.closed:
              raise ValueError, "I/O operation on closed file"
!         return False
  
      def seek(self, pos, mode = 0):

Index: chunk.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/chunk.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** chunk.py	11 May 2001 19:14:51 -0000	1.11
--- chunk.py	7 Apr 2002 06:36:22 -0000	1.12
***************
*** 26,30 ****
  
  Usage:
! while 1:
      try:
          chunk = Chunk(file)
--- 26,30 ----
  
  Usage:
! while True:
      try:
          chunk = Chunk(file)
***************
*** 32,36 ****
          break
      chunktype = chunk.getname()
!     while 1:
          data = chunk.read(nbytes)
          if not data:
--- 32,36 ----
          break
      chunktype = chunk.getname()
!     while True:
          data = chunk.read(nbytes)
          if not data:
***************
*** 50,56 ****
  
  class Chunk:
!     def __init__(self, file, align = 1, bigendian = 1, inclheader = 0):
          import struct
!         self.closed = 0
          self.align = align      # whether to align to word (2-byte) boundaries
          if bigendian:
--- 50,56 ----
  
  class Chunk:
!     def __init__(self, file, align=True, bigendian=True, inclheader=False):
          import struct
!         self.closed = False
          self.align = align      # whether to align to word (2-byte) boundaries
          if bigendian:
***************
*** 72,78 ****
              self.offset = self.file.tell()
          except (AttributeError, IOError):
!             self.seekable = 0
          else:
!             self.seekable = 1
  
      def getname(self):
--- 72,78 ----
              self.offset = self.file.tell()
          except (AttributeError, IOError):
!             self.seekable = False
          else:
!             self.seekable = True
  
      def getname(self):
***************
*** 87,98 ****
          if not self.closed:
              self.skip()
!             self.closed = 1
  
      def isatty(self):
          if self.closed:
              raise ValueError, "I/O operation on closed file"
!         return 0
  
!     def seek(self, pos, whence = 0):
          """Seek to specified position into the chunk.
          Default position is 0 (start of chunk).
--- 87,98 ----
          if not self.closed:
              self.skip()
!             self.closed = True
  
      def isatty(self):
          if self.closed:
              raise ValueError, "I/O operation on closed file"
!         return False
  
!     def seek(self, pos, whence=0):
          """Seek to specified position into the chunk.
          Default position is 0 (start of chunk).
***************
*** 118,122 ****
          return self.size_read
  
!     def read(self, size = -1):
          """Read at most size bytes from the chunk.
          If size is omitted or negative, read until the end
--- 118,122 ----
          return self.size_read
  
!     def read(self, size=-1):
          """Read at most size bytes from the chunk.
          If size is omitted or negative, read until the end

Index: dospath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dospath.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** dospath.py	4 Apr 2002 22:55:58 -0000	1.26
--- dospath.py	7 Apr 2002 06:36:22 -0000	1.27
***************
*** 142,146 ****
      This will always return false on systems where posix.lstat doesn't exist."""
  
!     return 0
  
  
--- 142,146 ----
      This will always return false on systems where posix.lstat doesn't exist."""
  
!     return False
  
  

Index: fileinput.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/fileinput.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** fileinput.py	26 Mar 2002 20:28:40 -0000	1.9
--- fileinput.py	7 Apr 2002 06:36:22 -0000	1.10
***************
*** 155,159 ****
          self._filelineno = 0
          self._file = None
!         self._isstdin = 0
          self._backupfilename = None
          self._buffer = []
--- 155,159 ----
          self._filelineno = 0
          self._file = None
!         self._isstdin = False
          self._backupfilename = None
          self._buffer = []
***************
*** 215,219 ****
              except: pass
  
!         self._isstdin = 0
          self._buffer = []
          self._bufindex = 0
--- 215,219 ----
              except: pass
  
!         self._isstdin = False
          self._buffer = []
          self._bufindex = 0
***************
*** 236,245 ****
              self._filelineno = 0
              self._file = None
!             self._isstdin = 0
              self._backupfilename = 0
              if self._filename == '-':
                  self._filename = '<stdin>'
                  self._file = sys.stdin
!                 self._isstdin = 1
              else:
                  if self._inplace:
--- 236,245 ----
              self._filelineno = 0
              self._file = None
!             self._isstdin = False
              self._backupfilename = 0
              if self._filename == '-':
                  self._filename = '<stdin>'
                  self._file = sys.stdin
!                 self._isstdin = True
              else:
                  if self._inplace:

Index: gzip.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/gzip.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** gzip.py	20 Mar 2002 18:36:00 -0000	1.30
--- gzip.py	7 Apr 2002 06:36:22 -0000	1.31
***************
*** 48,52 ****
              self.mode = READ
              # Set flag indicating start of a new member
!             self._new_member = 1
              self.extrabuf = ""
              self.extrasize = 0
--- 48,52 ----
              self.mode = READ
              # Set flag indicating start of a new member
!             self._new_member = True
              self.extrabuf = ""
              self.extrasize = 0
***************
*** 121,130 ****
          if flag & FNAME:
              # Read and discard a null-terminated string containing the filename
!             while (1):
                  s=self.fileobj.read(1)
                  if not s or s=='\000': break
          if flag & FCOMMENT:
              # Read and discard a null-terminated string containing a comment
!             while (1):
                  s=self.fileobj.read(1)
                  if not s or s=='\000': break
--- 121,130 ----
          if flag & FNAME:
              # Read and discard a null-terminated string containing the filename
!             while True:
                  s=self.fileobj.read(1)
                  if not s or s=='\000': break
          if flag & FCOMMENT:
              # Read and discard a null-terminated string containing a comment
!             while True:
                  s=self.fileobj.read(1)
                  if not s or s=='\000': break
***************
*** 157,161 ****
          if size < 0:        # get the whole thing
              try:
!                 while 1:
                      self._read(readsize)
                      readsize = readsize * 2
--- 157,161 ----
          if size < 0:        # get the whole thing
              try:
!                 while True:
                      self._read(readsize)
                      readsize = readsize * 2
***************
*** 202,206 ****
              self._read_gzip_header()
              self.decompress = zlib.decompressobj(-zlib.MAX_WBITS)
!             self._new_member = 0
  
          # Read a chunk of data from the file
--- 202,206 ----
              self._read_gzip_header()
              self.decompress = zlib.decompressobj(-zlib.MAX_WBITS)
!             self._new_member = False
  
          # Read a chunk of data from the file
***************
*** 230,234 ****
              # a new member on the next call
              self._read_eof()
!             self._new_member = 1
  
      def _add_read_data(self, data):
--- 230,234 ----
              # a new member on the next call
              self._read_eof()
!             self._new_member = True
  
      def _add_read_data(self, data):
***************
*** 276,280 ****
  
      def isatty(self):
!         return 0
  
      def tell(self):
--- 276,280 ----
  
      def isatty(self):
!         return False
  
      def tell(self):
***************
*** 287,291 ****
              raise IOError("Can't rewind in write mode")
          self.fileobj.seek(0)
!         self._new_member = 1
          self.extrabuf = ""
          self.extrasize = 0
--- 287,291 ----
              raise IOError("Can't rewind in write mode")
          self.fileobj.seek(0)
!         self._new_member = True
          self.extrabuf = ""
          self.extrasize = 0
***************
*** 312,316 ****
          bufs = []
          readsize = min(100, size)    # Read from the file in small chunks
!         while 1:
              if size == 0:
                  return "".join(bufs) # Return resulting line
--- 312,316 ----
          bufs = []
          readsize = min(100, size)    # Read from the file in small chunks
!         while True:
              if size == 0:
                  return "".join(bufs) # Return resulting line
***************
*** 343,347 ****
              line = self.readline()
              if line == "": break
!             L.append( line )
              sizehint = sizehint - len(line)
  
--- 343,347 ----
              line = self.readline()
              if line == "": break
!             L.append(line)
              sizehint = sizehint - len(line)
  
***************
*** 391,395 ****
                  f = __builtin__.open(arg, "rb")
                  g = open(arg + ".gz", "wb")
!         while 1:
              chunk = f.read(1024)
              if not chunk:
--- 391,395 ----
                  f = __builtin__.open(arg, "rb")
                  g = open(arg + ".gz", "wb")
!         while True:
              chunk = f.read(1024)
              if not chunk:

Index: macpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/macpath.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** macpath.py	4 Apr 2002 22:55:58 -0000	1.34
--- macpath.py	7 Apr 2002 06:36:23 -0000	1.35
***************
*** 126,130 ****
      Always false on the Mac, until we understand Aliases.)"""
  
!     return 0
  
  
--- 126,130 ----
      Always false on the Mac, until we understand Aliases.)"""
  
!     return False
  
  
***************
*** 135,139 ****
          st = os.stat(s)
      except os.error:
!         return 0
      return S_ISREG(st[ST_MODE])
  
--- 135,139 ----
          st = os.stat(s)
      except os.error:
!         return False
      return S_ISREG(st[ST_MODE])
  

Index: ntpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/ntpath.py,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** ntpath.py	4 Apr 2002 22:55:58 -0000	1.46
--- ntpath.py	7 Apr 2002 06:36:23 -0000	1.47
***************
*** 236,240 ****
  def islink(path):
      """Test for symbolic link.  On WindowsNT/95 always returns false"""
!     return 0
  
  
--- 236,240 ----
  def islink(path):
      """Test for symbolic link.  On WindowsNT/95 always returns false"""
!     return False
  
  
***************
*** 260,264 ****
          st = os.stat(path)
      except os.error:
!         return 0
      return stat.S_ISDIR(st[stat.ST_MODE])
  
--- 260,264 ----
          st = os.stat(path)
      except os.error:
!         return False
      return stat.S_ISDIR(st[stat.ST_MODE])
  
***************
*** 273,277 ****
          st = os.stat(path)
      except os.error:
!         return 0
      return stat.S_ISREG(st[stat.ST_MODE])
  
--- 273,277 ----
          st = os.stat(path)
      except os.error:
!         return False
      return stat.S_ISREG(st[stat.ST_MODE])
  

Index: os2emxpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/os2emxpath.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** os2emxpath.py	4 Apr 2002 22:55:58 -0000	1.2
--- os2emxpath.py	7 Apr 2002 06:36:23 -0000	1.3
***************
*** 195,199 ****
  def islink(path):
      """Test for symbolic link.  On OS/2 always returns false"""
!     return 0
  
  
--- 195,199 ----
  def islink(path):
      """Test for symbolic link.  On OS/2 always returns false"""
!     return False
  
  
***************
*** 217,221 ****
          st = os.stat(path)
      except os.error:
!         return 0
      return stat.S_ISDIR(st[stat.ST_MODE])
  
--- 217,221 ----
          st = os.stat(path)
      except os.error:
!         return False
      return stat.S_ISDIR(st[stat.ST_MODE])
  
***************
*** 230,234 ****
          st = os.stat(path)
      except os.error:
!         return 0
      return stat.S_ISREG(st[stat.ST_MODE])
  
--- 230,234 ----
          st = os.stat(path)
      except os.error:
!         return False
      return stat.S_ISREG(st[stat.ST_MODE])
  

Index: posixpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/posixpath.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** posixpath.py	4 Apr 2002 22:55:58 -0000	1.47
--- posixpath.py	7 Apr 2002 06:36:23 -0000	1.48
***************
*** 159,163 ****
          st = os.lstat(path)
      except (os.error, AttributeError):
!         return 0
      return stat.S_ISLNK(st[stat.ST_MODE])
  
--- 159,163 ----
          st = os.lstat(path)
      except (os.error, AttributeError):
!         return False
      return stat.S_ISLNK(st[stat.ST_MODE])
  
***************
*** 184,188 ****
          st = os.stat(path)
      except os.error:
!         return 0
      return stat.S_ISDIR(st[stat.ST_MODE])
  
--- 184,188 ----
          st = os.stat(path)
      except os.error:
!         return False
      return stat.S_ISDIR(st[stat.ST_MODE])
  
***************
*** 197,201 ****
          st = os.stat(path)
      except os.error:
!         return 0
      return stat.S_ISREG(st[stat.ST_MODE])
  
--- 197,201 ----
          st = os.stat(path)
      except os.error:
!         return False
      return stat.S_ISREG(st[stat.ST_MODE])
  
***************
*** 336,340 ****
          _varprog = re.compile(r'\$(\w+|\{[^}]*\})')
      i = 0
!     while 1:
          m = _varprog.search(path, i)
          if not m:
--- 336,340 ----
          _varprog = re.compile(r'\$(\w+|\{[^}]*\})')
      i = 0
!     while True:
          m = _varprog.search(path, i)
          if not m:

Index: pprint.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pprint.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** pprint.py	2 Apr 2002 05:08:35 -0000	1.20
--- pprint.py	7 Apr 2002 06:36:23 -0000	1.21
***************
*** 127,132 ****
          if objid in context:
              stream.write(_recursion(object))
!             self.__recursive = 1
!             self.__readable = 0
              return
          rep = self.__repr(object, context, level - 1)
--- 127,132 ----
          if objid in context:
              stream.write(_recursion(object))
!             self.__recursive = True
!             self.__readable = False
              return
          rep = self.__repr(object, context, level - 1)
***************
*** 196,202 ****
                                                  self.__depth, level)
          if not readable:
!             self.__readable = 0
          if recursive:
!             self.__recursive = 1
          return repr
  
--- 196,202 ----
                                                  self.__depth, level)
          if not readable:
!             self.__readable = False
          if recursive:
!             self.__recursive = True
          return repr
  
***************
*** 215,219 ****
      if typ is StringType:
          if 'locale' not in _sys_modules:
!             return `object`, 1, 0
          if "'" in object and '"' not in object:
              closure = '"'
--- 215,219 ----
      if typ is StringType:
          if 'locale' not in _sys_modules:
!             return `object`, True, False
          if "'" in object and '"' not in object:
              closure = '"'
***************
*** 230,246 ****
              else:
                  write(qget(char, `char`[1:-1]))
!         return ("%s%s%s" % (closure, sio.getvalue(), closure)), 1, 0
  
      if typ is DictType:
          if not object:
!             return "{}", 1, 0
          objid = _id(object)
          if maxlevels and level > maxlevels:
!             return "{...}", 0, objid in context
          if objid in context:
!             return _recursion(object), 0, 1
          context[objid] = 1
!         readable = 1
!         recursive = 0
          components = []
          append = components.append
--- 230,246 ----
              else:
                  write(qget(char, `char`[1:-1]))
!         return ("%s%s%s" % (closure, sio.getvalue(), closure)), True, False
  
      if typ is DictType:
          if not object:
!             return "{}", True, False
          objid = _id(object)
          if maxlevels and level > maxlevels:
!             return "{...}", False, objid in context
          if objid in context:
!             return _recursion(object), False, True
          context[objid] = 1
!         readable = True
!         recursive = False
          components = []
          append = components.append
***************
*** 253,257 ****
              readable = readable and kreadable and vreadable
              if krecur or vrecur:
!                 recursive = 1
          del context[objid]
          return "{%s}" % _commajoin(components), readable, recursive
--- 253,257 ----
              readable = readable and kreadable and vreadable
              if krecur or vrecur:
!                 recursive = True
          del context[objid]
          return "{%s}" % _commajoin(components), readable, recursive
***************
*** 260,264 ****
          if typ is ListType:
              if not object:
!                 return "[]", 1, 0
              format = "[%s]"
          elif _len(object) == 1:
--- 260,264 ----
          if typ is ListType:
              if not object:
!                 return "[]", True, False
              format = "[%s]"
          elif _len(object) == 1:
***************
*** 266,279 ****
          else:
              if not object:
!                 return "()", 1, 0
              format = "(%s)"
          objid = _id(object)
          if maxlevels and level > maxlevels:
!             return format % "...", 0, objid in context
          if objid in context:
!             return _recursion(object), 0, 1
          context[objid] = 1
!         readable = 1
!         recursive = 0
          components = []
          append = components.append
--- 266,279 ----
          else:
              if not object:
!                 return "()", True, False
              format = "(%s)"
          objid = _id(object)
          if maxlevels and level > maxlevels:
!             return format % "...", False, objid in context
          if objid in context:
!             return _recursion(object), False, True
          context[objid] = 1
!         readable = True
!         recursive = False
          components = []
          append = components.append
***************
*** 283,294 ****
              append(orepr)
              if not oreadable:
!                 readable = 0
              if orecur:
!                 recursive = 1
          del context[objid]
          return format % _commajoin(components), readable, recursive
  
      rep = `object`
!     return rep, (rep and not rep.startswith('<')), 0
  
  
--- 283,294 ----
              append(orepr)
              if not oreadable:
!                 readable = False
              if orecur:
!                 recursive = True
          del context[objid]
          return format % _commajoin(components), readable, recursive
  
      rep = `object`
!     return rep, (rep and not rep.startswith('<')), False
  
  

Index: pydoc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** pydoc.py	4 Apr 2002 22:55:58 -0000	1.61
--- pydoc.py	7 Apr 2002 06:36:23 -0000	1.62
***************
*** 444,448 ****
                                  r'PEP[- ]?(\d+)|'
                                  r'(self\.)?(\w+))')
!         while 1:
              match = pattern.search(text, here)
              if not match: break
--- 444,448 ----
                                  r'PEP[- ]?(\d+)|'
                                  r'(self\.)?(\w+))')
!         while True:
              match = pattern.search(text, here)
              if not match: break
***************
*** 1522,1526 ****
      def interact(self):
          self.output.write('\n')
!         while 1:
              self.output.write('help> ')
              self.output.flush()
--- 1522,1526 ----
      def interact(self):
          self.output.write('\n')
!         while True:
              self.output.write('help> ')
              self.output.flush()
***************
*** 1711,1718 ****
              self.inodes.append(inode) # detect circular symbolic links
              return ispackage(dir)
  
      def run(self, callback, key=None, completer=None):
          if key: key = lower(key)
!         self.quit = 0
          seen = {}
  
--- 1711,1719 ----
              self.inodes.append(inode) # detect circular symbolic links
              return ispackage(dir)
+         return False
  
      def run(self, callback, key=None, completer=None):
          if key: key = lower(key)
!         self.quit = False
          seen = {}
  
***************
*** 1826,1830 ****
          def serve_until_quit(self):
              import select
!             self.quit = 0
              while not self.quit:
                  rd, wr, ex = select.select([self.socket.fileno()], [], [], 1)
--- 1827,1831 ----
          def serve_until_quit(self):
              import select
!             self.quit = False
              while not self.quit:
                  rd, wr, ex = select.select([self.socket.fileno()], [], [], 1)

Index: rfc822.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/rfc822.py,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** rfc822.py	20 Dec 2001 15:54:48 -0000	1.66
--- rfc822.py	7 Apr 2002 06:36:23 -0000	1.67
***************
*** 223,227 ****
          free-text data.
          """
!         return None
  
      def getallmatchingheaders(self, name):
--- 223,227 ----
          free-text data.
          """
!         return False
  
      def getallmatchingheaders(self, name):

Index: sre_parse.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** sre_parse.py	11 Feb 2002 18:18:29 -0000	1.52
--- sre_parse.py	7 Apr 2002 06:36:23 -0000	1.53
***************
*** 222,230 ****
      # check that group name is a valid string
      if not isident(name[0]):
!         return 0
      for char in name:
          if not isident(char) and not isdigit(char):
!             return 0
!     return 1
  
  def _group(escape, groups):
--- 222,230 ----
      # check that group name is a valid string
      if not isident(name[0]):
!         return False
      for char in name:
          if not isident(char) and not isdigit(char):
!             return False
!     return True
  
  def _group(escape, groups):

Index: statcache.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/statcache.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** statcache.py	15 Feb 2001 22:15:13 -0000	1.11
--- statcache.py	7 Apr 2002 06:36:23 -0000	1.12
***************
*** 74,77 ****
          st = stat(path)
      except _os.error:
!         return 0
      return S_ISDIR(st[ST_MODE])
--- 74,77 ----
          st = stat(path)
      except _os.error:
!         return False
      return S_ISDIR(st[ST_MODE])

Index: threading.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/threading.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** threading.py	4 Apr 2002 22:55:58 -0000	1.22
--- threading.py	7 Apr 2002 06:36:23 -0000	1.23
***************
*** 31,35 ****
  # Debug support (adapted from ihooks.py)
  
! _VERBOSE = 0
  
  if __debug__:
--- 31,35 ----
  # Debug support (adapted from ihooks.py)
  
! _VERBOSE = 0 # XXX Bool or int?
  
  if __debug__:
***************
*** 199,203 ****
                  endtime = _time() + timeout
                  delay = 0.0005 # 500 us -> initial delay of 1 ms
!                 while 1:
                      gotit = waiter.acquire(0)
                      if gotit:
--- 199,203 ----
                  endtime = _time() + timeout
                  delay = 0.0005 # 500 us -> initial delay of 1 ms
!                 while True:
                      gotit = waiter.acquire(0)
                      if gotit:
***************
*** 257,261 ****
  
      def acquire(self, blocking=1):
!         rc = 0
          self.__cond.acquire()
          while self.__value == 0:
--- 257,261 ----
  
      def acquire(self, blocking=1):
!         rc = False
          self.__cond.acquire()
          while self.__value == 0:
***************
*** 271,275 ****
                  self._note("%s.acquire: success, value=%s",
                             self, self.__value)
!             rc = 1
          self.__cond.release()
          return rc
--- 271,275 ----
                  self._note("%s.acquire: success, value=%s",
                             self, self.__value)
!             rc = True
          self.__cond.release()
          return rc
***************
*** 310,314 ****
          _Verbose.__init__(self, verbose)
          self.__cond = Condition(Lock())
!         self.__flag = 0
  
      def isSet(self):
--- 310,314 ----
          _Verbose.__init__(self, verbose)
          self.__cond = Condition(Lock())
!         self.__flag = False
  
      def isSet(self):
***************
*** 317,321 ****
      def set(self):
          self.__cond.acquire()
!         self.__flag = 1
          self.__cond.notifyAll()
          self.__cond.release()
--- 317,321 ----
      def set(self):
          self.__cond.acquire()
!         self.__flag = True
          self.__cond.notifyAll()
          self.__cond.release()
***************
*** 323,327 ****
      def clear(self):
          self.__cond.acquire()
!         self.__flag = 0
          self.__cond.release()
  
--- 323,327 ----
      def clear(self):
          self.__cond.acquire()
!         self.__flag = False
          self.__cond.release()
  
***************
*** 349,353 ****
  class Thread(_Verbose):
  
!     __initialized = 0
  
      def __init__(self, group=None, target=None, name=None,
--- 349,353 ----
  class Thread(_Verbose):
  
!     __initialized = False
  
      def __init__(self, group=None, target=None, name=None,
***************
*** 360,367 ****
          self.__kwargs = kwargs
          self.__daemonic = self._set_daemon()
!         self.__started = 0
!         self.__stopped = 0
          self.__block = Condition(Lock())
!         self.__initialized = 1
  
      def _set_daemon(self):
--- 360,367 ----
          self.__kwargs = kwargs
          self.__daemonic = self._set_daemon()
!         self.__started = False
!         self.__stopped = False
          self.__block = Condition(Lock())
!         self.__initialized = True
  
      def _set_daemon(self):
***************
*** 389,393 ****
          _active_limbo_lock.release()
          _start_new_thread(self.__bootstrap, ())
!         self.__started = 1
          _sleep(0.000001)    # 1 usec, to let the thread run (Solaris hack)
  
--- 389,393 ----
          _active_limbo_lock.release()
          _start_new_thread(self.__bootstrap, ())
!         self.__started = True
          _sleep(0.000001)    # 1 usec, to let the thread run (Solaris hack)
  
***************
*** 398,402 ****
      def __bootstrap(self):
          try:
!             self.__started = 1
              _active_limbo_lock.acquire()
              _active[_get_ident()] = self
--- 398,402 ----
      def __bootstrap(self):
          try:
!             self.__started = True
              _active_limbo_lock.acquire()
              _active[_get_ident()] = self
***************
*** 429,433 ****
      def __stop(self):
          self.__block.acquire()
!         self.__stopped = 1
          self.__block.notifyAll()
          self.__block.release()
--- 429,433 ----
      def __stop(self):
          self.__block.acquire()
!         self.__stopped = True
          self.__block.notifyAll()
          self.__block.release()
***************
*** 524,528 ****
      def __init__(self):
          Thread.__init__(self, name="MainThread")
!         self._Thread__started = 1
          _active_limbo_lock.acquire()
          _active[_get_ident()] = self
--- 524,528 ----
      def __init__(self):
          Thread.__init__(self, name="MainThread")
!         self._Thread__started = True
          _active_limbo_lock.acquire()
          _active[_get_ident()] = self
***************
*** 532,536 ****
  
      def _set_daemon(self):
!         return 0
  
      def __exitfunc(self):
--- 532,536 ----
  
      def _set_daemon(self):
!         return False
  
      def __exitfunc(self):
***************
*** 565,569 ****
      def __init__(self):
          Thread.__init__(self, name=_newname("Dummy-%d"))
!         self._Thread__started = 1
          _active_limbo_lock.acquire()
          _active[_get_ident()] = self
--- 565,569 ----
      def __init__(self):
          Thread.__init__(self, name=_newname("Dummy-%d"))
!         self._Thread__started = True
          _active_limbo_lock.acquire()
          _active[_get_ident()] = self
***************
*** 571,578 ****
  
      def _set_daemon(self):
!         return 1
  
      def join(self, timeout=None):
!         assert 0, "cannot join a dummy thread"
  
  
--- 571,578 ----
  
      def _set_daemon(self):
!         return True
  
      def join(self, timeout=None):
!         assert False, "cannot join a dummy thread"
  
  

Index: urllib2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** urllib2.py	18 Mar 2002 08:37:19 -0000	1.26
--- urllib2.py	7 Apr 2002 06:36:23 -0000	1.27
***************
*** 547,557 ****
          """
          if base == test:
!             return 1
          if base[0] != test[0]:
!             return 0
          common = posixpath.commonprefix((base[1], test[1]))
          if len(common) == len(base[1]):
!             return 1
!         return 0
  
  
--- 547,557 ----
          """
          if base == test:
!             return True
          if base[0] != test[0]:
!             return False
          common = posixpath.commonprefix((base[1], test[1]))
          if len(common) == len(base[1]):
!             return True
!         return False
  
  

Index: zipfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/zipfile.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** zipfile.py	6 Dec 2001 06:23:25 -0000	1.20
--- zipfile.py	7 Apr 2002 06:36:23 -0000	1.21
***************
*** 84,90 ****
          fpin.close()
          if endrec[0:4] == "PK\005\006" and endrec[-2:] == "\000\000":
!             return 1    # file has correct magic number
      except IOError:
          pass
  
  
--- 84,91 ----
          fpin.close()
          if endrec[0:4] == "PK\005\006" and endrec[-2:] == "\000\000":
!             return True                 # file has correct magic number
      except IOError:
          pass
+     return False