[Zodb-checkins] CVS: StandaloneZConfig/ZConfig - datatypes.py:1.24

Fred L. Drake, Jr. fred at zope.com
Thu Feb 5 11:41:00 EST 2004


Update of /cvs-repository/StandaloneZConfig/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv12716/ZConfig

Modified Files:
	datatypes.py 
Log Message:
fix the default hostname for address datatypes for Windows


=== StandaloneZConfig/ZConfig/datatypes.py 1.23 => 1.24 ===
--- StandaloneZConfig/ZConfig/datatypes.py:1.23	Mon Jan 12 00:57:31 2004
+++ StandaloneZConfig/ZConfig/datatypes.py	Thu Feb  5 11:40:28 2004
@@ -175,6 +175,11 @@
 port_number = RangeCheckedConversion(integer, min=1, max=0xffff).__call__
 
 
+if sys.platform[:3] == "win":
+    DEFAULT_HOST = "localhost"
+else:
+    DEFAULT_HOST = ""
+
 def inet_address(s):
     # returns (host, port) tuple
     host = ''
@@ -191,6 +196,8 @@
             if len(s.split()) != 1:
                 raise ValueError("not a valid host name: " + repr(s))
             host = s.lower()
+    if not host:
+        host = DEFAULT_HOST
     return host, port
 
 




More information about the Zodb-checkins mailing list