[Zodb-checkins] CVS: ZODB4/src/zodb/zeo - client.py:1.8 monitor.py:1.4 runsvr.py:1.3 server.py:1.10

Barry Warsaw barry@wooz.org
Thu, 13 Mar 2003 17:12:06 -0500


Update of /cvs-repository/ZODB4/src/zodb/zeo
In directory cvs.zope.org:/tmp/cvs-serv922/src/zodb/zeo

Modified Files:
	client.py monitor.py runsvr.py server.py 
Log Message:
Eradicate the types module in ZODB (where possible).  Also normalize
on isinstance() instead of type comparisons.


=== ZODB4/src/zodb/zeo/client.py 1.7 => 1.8 ===
--- ZODB4/src/zodb/zeo/client.py:1.7	Thu Mar 13 16:32:30 2003
+++ ZODB4/src/zodb/zeo/client.py	Thu Mar 13 17:11:35 2003
@@ -28,7 +28,6 @@
 import tempfile
 import threading
 import time
-import types
 import logging
 
 from zodb.zeo import cache
@@ -414,10 +413,10 @@
 
     def set_server_addr(self, addr):
         # Normalize server address and convert to string
-        if isinstance(addr, types.StringType):
+        if isinstance(addr, str):
             self._server_addr = addr
         else:
-            assert isinstance(addr, types.TupleType)
+            assert isinstance(addr, tuple)
             # If the server is on a remote host, we need to guarantee
             # that all clients used the same name for the server.  If
             # they don't, the sortKey() may be different for each client.


=== ZODB4/src/zodb/zeo/monitor.py 1.3 => 1.4 ===
--- ZODB4/src/zodb/zeo/monitor.py:1.3	Thu Mar  6 15:47:06 2003
+++ ZODB4/src/zodb/zeo/monitor.py	Thu Mar 13 17:11:35 2003
@@ -19,7 +19,6 @@
 import asyncore
 import socket
 import time
-import types
 
 import zodb.zeo
 
@@ -123,7 +122,7 @@
         asyncore.dispatcher.__init__(self)
         self.addr = addr
         self.stats = stats
-        if type(self.addr) == types.TupleType:
+        if isinstance(self.addr, tuple):
             self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
         else:
             self.create_socket(socket.AF_UNIX, socket.SOCK_STREAM)


=== ZODB4/src/zodb/zeo/runsvr.py 1.2 => 1.3 ===
--- ZODB4/src/zodb/zeo/runsvr.py:1.2	Wed Dec 25 09:12:22 2002
+++ ZODB4/src/zodb/zeo/runsvr.py	Thu Mar 13 17:11:35 2003
@@ -294,10 +294,10 @@
             return 1
 
     def clear_socket(self):
-        if isinstance(self.options.address, type("")):
+        if isinstance(self.options.address, str):
             try:
                 os.unlink(self.options.address)
-            except os.error:
+            except OSError:
                 pass
 
     def open_storages(self):


=== ZODB4/src/zodb/zeo/server.py 1.9 => 1.10 ===
--- ZODB4/src/zodb/zeo/server.py:1.9	Thu Mar 13 16:32:30 2003
+++ ZODB4/src/zodb/zeo/server.py	Thu Mar 13 17:11:35 2003
@@ -78,7 +78,7 @@
         self.connection = conn # For restart_other() below
         self.client = self.ClientStorageStubClass(conn)
         addr = conn.addr
-        if isinstance(addr, type("")):
+        if isinstance(addr, str):
             self.log_label = addr
         else:
             host, port = addr