[Zodb-checkins] CVS: Packages/ZConfig - datatypes.py:1.1.2.20

Fred L. Drake, Jr. fred@zope.com
Tue, 24 Dec 2002 22:54:57 -0500


Update of /cvs-repository/Packages/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv1828

Modified Files:
      Tag: zconfig-schema-devel-branch
	datatypes.py 
Log Message:
Modify the socket-address data type to raise ValueError when the value
corresponds to an AF_UNIX address on Windows.  Not really sure this is the
right thing, but avoids looking for socket.AF_UNIX when it doesn't exist.


=== Packages/ZConfig/datatypes.py 1.1.2.19 => 1.1.2.20 ===
--- Packages/ZConfig/datatypes.py:1.1.2.19	Sat Dec 21 23:18:45 2002
+++ Packages/ZConfig/datatypes.py	Tue Dec 24 22:54:25 2002
@@ -178,7 +178,11 @@
     # returns (family, address) tuple
     import socket
     if "/" in s:
-        return socket.AF_UNIX, s
+        if hasattr(socket, "AF_UNIX"):
+            return socket.AF_UNIX, s
+        else:
+            raise ValueError(
+                "AF_UNIX sockets are not supported on this platform")
     else:
         return socket.AF_INET, inet_address(s)