[Python-checkins] python/dist/src/Lib telnetlib.py,1.18,1.19 traceback.py,1.26,1.27 urllib.py,1.145,1.146 webbrowser.py,1.31,1.32 xmlrpclib.py,1.17,1.18

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Sat, 01 Jun 2002 20:04:54 -0700


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

Modified Files:
	telnetlib.py traceback.py urllib.py webbrowser.py xmlrpclib.py 
Log Message:
Replaced boolean tests with is None.

Index: telnetlib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/telnetlib.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** telnetlib.py	13 May 2002 14:55:33 -0000	1.18
--- telnetlib.py	2 Jun 2002 03:04:51 -0000	1.19
***************
*** 187,191 ****
          self.eof = 0
          self.option_callback = None
!         if host:
              self.open(host, port)
  
--- 187,191 ----
          self.eof = 0
          self.option_callback = None
!         if host is not None:
              self.open(host, port)
  

Index: traceback.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/traceback.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** traceback.py	10 Jun 2001 18:58:26 -0000	1.26
--- traceback.py	2 Jun 2002 03:04:51 -0000	1.27
***************
*** 17,21 ****
      """Print the list of tuples as returned by extract_tb() or
      extract_stack() as a formatted stack trace to the given file."""
!     if not file:
          file = sys.stderr
      for filename, lineno, name, line in extracted_list:
--- 17,21 ----
      """Print the list of tuples as returned by extract_tb() or
      extract_stack() as a formatted stack trace to the given file."""
!     if file is None:
          file = sys.stderr
      for filename, lineno, name, line in extracted_list:
***************
*** 52,56 ****
      method.
      """
!     if not file:
          file = sys.stderr
      if limit is None:
--- 52,56 ----
      method.
      """
!     if file is None:
          file = sys.stderr
      if limit is None:
***************
*** 117,121 ****
      position of the error.
      """
!     if not file:
          file = sys.stderr
      if tb:
--- 117,121 ----
      position of the error.
      """
!     if file is None:
          file = sys.stderr
      if tb:
***************
*** 204,208 ****
      (In fact, it uses sys.exc_info() to retrieve the same information
      in a thread-safe way.)"""
!     if not file:
          file = sys.stderr
      try:
--- 204,208 ----
      (In fact, it uses sys.exc_info() to retrieve the same information
      in a thread-safe way.)"""
!     if file is None:
          file = sys.stderr
      try:
***************
*** 215,219 ****
      """This is a shorthand for 'print_exception(sys.last_type,
      sys.last_value, sys.last_traceback, limit, file)'."""
!     if not file:
          file = sys.stderr
      print_exception(sys.last_type, sys.last_value, sys.last_traceback,
--- 215,219 ----
      """This is a shorthand for 'print_exception(sys.last_type,
      sys.last_value, sys.last_traceback, limit, file)'."""
!     if file is None:
          file = sys.stderr
      print_exception(sys.last_type, sys.last_value, sys.last_traceback,

Index: urllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v
retrieving revision 1.145
retrieving revision 1.146
diff -C2 -d -r1.145 -r1.146
*** urllib.py	1 Jun 2002 14:18:47 -0000	1.145
--- urllib.py	2 Jun 2002 03:04:51 -0000	1.146
***************
*** 204,208 ****
              return self.tempcache[url]
          type, url1 = splittype(url)
!         if not filename and (not type or type == 'file'):
              try:
                  fp = self.open_local_file(url1)
--- 204,208 ----
              return self.tempcache[url]
          type, url1 = splittype(url)
!         if filename is None and (not type or type == 'file'):
              try:
                  fp = self.open_local_file(url1)
***************
*** 663,667 ****
      """Return the IP address of the magic hostname 'localhost'."""
      global _localhost
!     if not _localhost:
          _localhost = socket.gethostbyname('localhost')
      return _localhost
--- 663,667 ----
      """Return the IP address of the magic hostname 'localhost'."""
      global _localhost
!     if _localhost is None:
          _localhost = socket.gethostbyname('localhost')
      return _localhost
***************
*** 671,675 ****
      """Return the IP address of the current host."""
      global _thishost
!     if not _thishost:
          _thishost = socket.gethostbyname(socket.gethostname())
      return _thishost
--- 671,675 ----
      """Return the IP address of the current host."""
      global _thishost
!     if _thishost is None:
          _thishost = socket.gethostbyname(socket.gethostname())
      return _thishost
***************
*** 679,683 ****
      """Return the set of errors raised by the FTP class."""
      global _ftperrors
!     if not _ftperrors:
          import ftplib
          _ftperrors = ftplib.all_errors
--- 679,683 ----
      """Return the set of errors raised by the FTP class."""
      global _ftperrors
!     if _ftperrors is None:
          import ftplib
          _ftperrors = ftplib.all_errors
***************
*** 688,692 ****
      """Return an empty mimetools.Message object."""
      global _noheaders
!     if not _noheaders:
          import mimetools
          import StringIO
--- 688,692 ----
      """Return an empty mimetools.Message object."""
      global _noheaders
!     if _noheaders is None:
          import mimetools
          import StringIO

Index: webbrowser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/webbrowser.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** webbrowser.py	1 Jun 2002 14:18:47 -0000	1.31
--- webbrowser.py	2 Jun 2002 03:04:52 -0000	1.32
***************
*** 18,22 ****
  def get(using=None):
      """Return a browser launcher instance appropriate for the environment."""
!     if using:
          alternatives = [using]
      else:
--- 18,22 ----
  def get(using=None):
      """Return a browser launcher instance appropriate for the environment."""
!     if using is not None:
          alternatives = [using]
      else:

Index: xmlrpclib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xmlrpclib.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** xmlrpclib.py	1 Jun 2002 14:18:47 -0000	1.17
--- xmlrpclib.py	2 Jun 2002 03:04:52 -0000	1.18
***************
*** 756,760 ****
          assert len(params) == 1, "response tuple must be a singleton"
  
!     if not encoding:
          encoding = "utf-8"
  
--- 756,760 ----
          assert len(params) == 1, "response tuple must be a singleton"
  
!     if encoding is None:
          encoding = "utf-8"
  
***************
*** 768,772 ****
  
      # standard XML-RPC wrappings
!     if methodname:
          # a method call
          if not isinstance(methodname, StringType):
--- 768,772 ----
  
      # standard XML-RPC wrappings
!     if methodname is not None:
          # a method call
          if not isinstance(methodname, StringType):